Search Posts
Search for LinkedIn posts by keywords with optional filtering by author job titles
POST
/linkedin/posts/searchSearch Posts
Search for LinkedIn posts by keywords with optional filtering by author job titles
Authentication requiredLinkedIn Posts
Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/posts/search' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"keywords":"artificial intelligence"}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID (uses default if not provided) |
keywords | string | Yes | Search keywords |
count | number | No | Number of posts to return (1-50, default: 10) |
start | number | No | Starting position for pagination (default: 0) |
datePosted | string | No | Date filter: 'past-24h', 'past-week', 'past-month', 'any-time' (default: 'any-time') |
sortBy | string | No | Sort order: 'relevance', 'date_posted' (default: 'relevance') |
authorJobTitles | array | No | Array of job titles to filter posts by author's job title (max 5 titles). Examples: ['CEO', 'CTO', 'Founder', 'Director', 'VP'] |
Example
{
"keywords": "artificial intelligence"
}Responses
| Status | Description |
|---|---|
| 200 | Successful response |
200 Example
{
"success": true,
"keywords": "artificial intelligence",
"accountId": "507f1f77bcf86cd799439011",
"posts": [
{
"url": "https://www.linkedin.com/posts/...",
"content": "AI is transforming industries...",
"authorName": "John Smith",
"authorProfileId": "john-smith-789",
"createdAt": "2024-01-15T10:30:00Z"
}
],
"pagination": {
"start": 0,
"count": 10,
"total": 50,
"hasMore": true,
"nextStart": 10
},
"filters": {
"datePosted": "past-week",
"sortBy": "relevance",
"authorJobTitles": [
"CEO",
"CTO",
"Founder"
]
}
}