Search Posts
POST /search-posts
Search for LinkedIn posts by keyword.
Pricing
5 credits per call.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
keyword | string | Yes | Search keyword |
sort_by | string | No | Sort order: date or relevance (default: relevance) |
date_posted | string | No | Date filter: past-24h, past-week, past-month |
start | integer | No | Starting offset (default: 0) |
Example Request
- cURL
- Python
- Node.js
curl --request POST \
--url 'https://api.infoplug.io/search-posts' \
--header 'X-INFOPLUG-API-KEY: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"keyword": "artificial intelligence",
"sort_by": "date",
"date_posted": "past-week"
}'
import requests
url = "https://api.infoplug.io/search-posts"
headers = {
"X-INFOPLUG-API-KEY": "YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"keyword": "artificial intelligence",
"sort_by": "date",
"date_posted": "past-week"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://api.infoplug.io/search-posts', {
method: 'POST',
headers: {
'X-INFOPLUG-API-KEY': 'YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
keyword: 'artificial intelligence',
sort_by: 'date',
date_posted: 'past-week'
})
});
const data = await response.json();
console.log(data);
Example Response
- 200 OK
- 400 Bad Request
- 401 Unauthorized
{
"data": {
"posts": [
{
"urn": "urn:li:activity:1234567890",
"author_name": "John Doe",
"author_linkedin_url": "https://www.linkedin.com/in/johndoe/",
"author_headline": "AI Researcher at Tech Corp",
"text": "Exciting developments in AI...",
"posted_at": "2024-01-15T10:30:00Z",
"reactions_count": 500,
"comments_count": 75,
"reposts_count": 25
}
],
"paging": {
"start": 0,
"count": 25,
"total": 1000
}
}
}
{
"message": "invalid_parameter",
"parameter": "keyword",
"details": "Keyword is required"
}
{
"message": "unauthorized",
"details": "Invalid or missing API key"
}
Related Endpoints
- Get Post Reactions - Get reactions on a post
- Get Post Comments - Get comments on a post