> ## Documentation Index
> Fetch the complete documentation index at: https://fdocs.info/llms.txt
> Use this file to discover all available pages before exploring further.

# Search Posts

> - Simulates LinkedIn's Post Search Function with most important filters.  

 - 1 credit per 20 posts retrieved.

```bash cURL theme={null}
curl --request POST \
	--url 'https://live-fetch.p.rapidapi.com/search-posts' \
	--header 'x-rapidapi-host: live-fetch.p.rapidapi.com' \
	--header 'x-rapidapi-key: YOUR_RAPIDAPI_KEY' \
	--header 'Content-Type: application/json' \
	--data '{"search_keywords": "", "sort_by": "Latest", "date_posted": "", "content_type": "", "from_member": ["ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc"], "from_company": [], "mentioning_member": [], "mentioning_company": [], "author_company": [], "author_industry": [], "author_keyword": "", "limit": 20}'
```

```python Python theme={null}
import requests

url = "https://live-fetch.p.rapidapi.com/search-posts"

payload = {
    "search_keywords": "",
    "sort_by": "Latest",
    "date_posted": "",
    "content_type": "",
    "from_member": ["ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc"],
    "from_company": [],
    "mentioning_member": [],
    "mentioning_company": [],
    "author_company": [],
    "author_industry": [],
    "author_keyword": "",
    "limit": 20
}

headers = {
    "x-rapidapi-key": "YOUR_RAPIDAPI_KEY",
    "x-rapidapi-host": "live-fetch.p.rapidapi.com",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, json=payload)

print(response.json())
```

```javascript JavaScript theme={null}
const url = 'https://live-fetch.p.rapidapi.com/search-posts';
const options = {
	method: 'POST',
	headers: {
		'x-rapidapi-key': 'YOUR_RAPIDAPI_KEY',
		'x-rapidapi-host': 'live-fetch.p.rapidapi.com',
		'Content-Type': 'application/json'
	},
	body: JSON.stringify({
		"search_keywords": "",
		"sort_by": "Latest",
		"date_posted": "",
		"content_type": "",
		"from_member": ["ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc"],
		"from_company": [],
		"mentioning_member": [],
		"mentioning_company": [],
		"author_company": [],
		"author_industry": [],
		"author_keyword": "",
		"limit": 20
	})
};

try {
	const response = await fetch(url, options);
	const result = await response.json();
	console.log(result);
} catch (error) {
	console.error(error);
}
```

```php PHP theme={null}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
	CURLOPT_URL => "https://live-fetch.p.rapidapi.com/search-posts",
	CURLOPT_RETURNTRANSFER => true,
	CURLOPT_CUSTOMREQUEST => "POST",
	CURLOPT_POSTFIELDS => '{"search_keywords": "", "sort_by": "Latest", "date_posted": "", "content_type": "", "from_member": ["ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc"], "from_company": [], "mentioning_member": [], "mentioning_company": [], "author_company": [], "author_industry": [], "author_keyword": "", "limit": 20}',
	CURLOPT_HTTPHEADER => [
		"x-rapidapi-host: live-fetch.p.rapidapi.com",
		"x-rapidapi-key: YOUR_RAPIDAPI_KEY",
		"Content-Type: application/json"
	],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
	echo "cURL Error #:" . $err;
} else {
	echo $response;
}
```

```go Go theme={null}
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	payload := strings.NewReader(`{"search_keywords": "", "sort_by": "Latest", "date_posted": "", "content_type": "", "from_member": ["ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc"], "from_company": [], "mentioning_member": [], "mentioning_company": [], "author_company": [], "author_industry": [], "author_keyword": "", "limit": 20}`)

	req, _ := http.NewRequest("POST", "https://live-fetch.p.rapidapi.com/search-posts", payload)

	req.Header.Add("x-rapidapi-key", "YOUR_RAPIDAPI_KEY")
	req.Header.Add("x-rapidapi-host", "live-fetch.p.rapidapi.com")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))
}
```

```java Java theme={null}
HttpRequest request = HttpRequest.newBuilder()
		.uri(URI.create("https://live-fetch.p.rapidapi.com/search-posts"))
		.header("x-rapidapi-key", "YOUR_RAPIDAPI_KEY")
		.header("x-rapidapi-host", "live-fetch.p.rapidapi.com")
		.header("Content-Type", "application/json")
		.method("POST", HttpRequest.BodyPublishers.ofString("{\"search_keywords\": \"\", \"sort_by\": \"Latest\", \"date_posted\": \"\", \"content_type\": \"\", \"from_member\": [\"ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc\"], \"from_company\": [], \"mentioning_member\": [], \"mentioning_company\": [], \"author_company\": [], \"author_industry\": [], \"author_keyword\": \"\", \"limit\": 20}"))
		.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```


## OpenAPI

````yaml POST /search-posts
openapi: 3.0.1
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://live-fetch.p.rapidapi.com
security:
  - ApiKeyAuth: []
paths:
  /search-posts:
    post:
      description: >-
        - Simulates LinkedIn's Post Search Function with most important
        filters.  

         - 1 credit per 20 posts retrieved.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                search_keywords:
                  type: string
                  description: ''
                  example: marketing
                sort_by:
                  type: string
                  description: ''
                  enum:
                    - Latest
                    - Top match
                  default: Top match
                date_posted:
                  type: string
                  nullable: true
                  description: Filter posts by a specific date or date range.
                  enum:
                    - Past 24 hours
                    - Past week
                    - Past month
                    - past-year
                    - past-2y
                    - past-3y
                  example: Past week
                content_type:
                  type: string
                  nullable: true
                  description: ''
                  enum:
                    - Videos
                    - Images
                    - Job posts
                    - Live videos
                    - Documents
                    - Collaborative articles
                  example: Images
                from_member:
                  type: array
                  items:
                    type: string
                  nullable: true
                  description: List of LinkedIn URNs.
                  example:
                    - ACoAAAGafwYBi3pXOoVVwIyAFc453DuIv50jfTA
                from_company:
                  type: array
                  items:
                    type: integer
                  nullable: true
                  description: >-
                    Learn how to [find a
                    company_id](https://fdocs.info/tutorial/howto-find-company-id).
                  example:
                    - 1035
                    - 1586
                mentioning_member:
                  type: array
                  items:
                    type: string
                  nullable: true
                  description: List of LinkedIn URNs.
                  example:
                    - ACoAAAGafwYBi3pXOoVVwIyAFc453DuIv50jfTA
                mentioning_company:
                  type: array
                  items:
                    type: integer
                  nullable: true
                  description: >-
                    Learn how to [find a
                    company_id](https://fdocs.info/tutorial/howto-find-company-id).
                  example:
                    - 1035
                    - 1586
                author_company:
                  type: array
                  items:
                    type: integer
                  nullable: true
                  description: >-
                    Learn how to [find a
                    company_id](https://fdocs.info/tutorial/howto-find-company-id).
                  example:
                    - 1035
                    - 1586
                author_industry:
                  type: array
                  items:
                    type: integer
                  nullable: true
                  description: >-
                    All industry codes could be found [on this page](
                    https://learn.microsoft.com/en-us/linkedin/shared/references/reference-tables/industry-codes-v2).
                  example:
                    - 3
                    - 4
                author_keyword:
                  type: string
                  nullable: true
                  description: Author title keywords.
                  example: marketing manager
                limit:
                  type: integer
                  description: >-
                    Number of posts to retrieve. Must be a multiple of 20 (20,
                    40, 60, 80, 100). Minimum and default is 20, maximum is 100.
                    Costs 1 credit per 20 posts.
                  example: 20
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchPosts'
        '400':
          description: 'Bad request: Invalid date_posted.'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    nullable: true
                    example: null
                  message:
                    type: string
                    example: 'Bad request: Invalid date_posted.'
        '503':
          description: System error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemError'
components:
  schemas:
    SearchPosts:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              num_comments:
                type: integer
                nullable: true
                example: null
              num_likes:
                type: integer
                nullable: true
                example: null
              num_shares:
                type: integer
                nullable: true
                example: null
              post_type:
                type: string
                example: photo
              post_url:
                type: string
                format: uri
                example: >-
                  https://www.linkedin.com/feed/update/urn:li:activity:7206932158031003648/
              posted:
                type: string
                example: '2024-06-13 08:15:24'
              poster_linkedin_url:
                type: string
                format: uri
                example: >-
                  https://www.linkedin.com/in/ACoAAAJcHacBGQdA-cxEAGl5Q1swIHXwixZMAK4?miniProfileUrn=urn%3Ali%3Afs_miniProfile%3AACoAAAJcHacBGQdA-cxEAGl5Q1swIHXwixZMAK4
              poster_name:
                type: string
                example: Ron Bar El
              poster_title:
                type: string
                example: >-
                  Chief TechStoryteller Officer | Founder of turba, Tech
                  storytelling & Brand strategy agency | Speaker
              text:
                type: string
                example: >-
                  The #AI #Narrative War: Beyond the technological battle for AI
                  supremacy among the tech giants...
              urn:
                type: string
                example: '7206932158031003648'
              document:
                type: string
                nullable: true
                example: null
              images:
                type: array
                items:
                  type: string
              is_sponsored:
                type: boolean
                example: false
              poster_image_url:
                type: string
                example: >-
                  https://media.licdn.com/dms/image/v2/D5603AQF-RYZP55jmXA/profile-displayphoto-shrink_800_800/B56ZRi8g.aGsAc-/0/1736826818808?e=1795651200&v=beta&t=mD0uLOs1cjCSID5jb-exghLe2V4aVjHH0k8FRoFITLM
              reshared:
                type: boolean
                example: false
              share_urn:
                type: string
                example: '7524292224508096512'
            required:
              - post_type
              - post_url
              - posted
              - poster_name
              - urn
        message:
          type: string
          example: ok
      required:
        - data
        - message
    SystemError:
      type: object
      properties:
        data:
          type: object
          nullable: true
          example: null
        message:
          type: string
          example: >-
            System error. You will not be charged for this request. We will fix
            it soon!
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-rapidapi-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.