Search Posts

Search for LinkedIn posts by keywords with optional filtering by author job titles

POST/linkedin/posts/search

Search 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

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID (uses default if not provided)
keywordsstringYesSearch keywords
countnumberNoNumber of posts to return (1-50, default: 10)
startnumberNoStarting position for pagination (default: 0)
datePostedstringNoDate filter: 'past-24h', 'past-week', 'past-month', 'any-time' (default: 'any-time')
sortBystringNoSort order: 'relevance', 'date_posted' (default: 'relevance')
authorJobTitlesarrayNoArray 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

StatusDescription
200Successful 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"
    ]
  }
}