Search LinkedIn posts (V2 - with auto-pagination)
Search for LinkedIn posts with enhanced filtering options and automatic pagination. Automatically handles LinkedIn pagination internally - specify the total count you want (max 50) and the API will fetch multiple pages as needed (max 10 pages, 10 results per page). Supports filtering by date, content type, author, and more. Important: This V2 endpoint uses LinkedIn's newer search, which is rolling out gradually by region. If this endpoint does not return results for your account, use the V1 `/search/posts` endpoint instead. Rate limit: 1,000 search calls per account per day (resets at midnight UTC), and 30 calls per minute. One request counts as one call regardless of `count`.
/search/posts/v2Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/search/posts/v2' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"accountId":"acc_12345","keywords":"","count":10,"start":0,"exactSearch":true,"filters":{"sortBy":"example_value","datePosted":["2024-01-15"],"contentType":["default"],"postedBy":["example_value"],"fromMember":["example_value"],"fromOrganization":["example_value"],"mentionsMember":["example_value"],"mentionsOrganization":["example_value"],"authorCompany":["Acme Inc"],"authorIndustry":["Technology"],"authorJobTitle":["Senior Developer"]}}'Search for LinkedIn posts with enhanced filtering options and automatic pagination. Automatically handles LinkedIn pagination internally - specify the total count you want (max 50) and the API will fetch multiple pages as needed (max 10 pages, 10 results per page). Supports filtering by date, content type, author, and more.
Important: This V2 endpoint uses LinkedIn's newer search, which is rolling out gradually by region. If this endpoint does not return results for your account, use the V1 /search/posts endpoint instead.
Rate limit: 1,000 search calls per account per day (resets at midnight UTC), and 30 calls per minute. One request counts as one call regardless of count.
Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID to use. If not provided, uses the default account. |
keywords | string | No | Search keywords for post content |
count | number | No | Total number of posts to return. API will automatically paginate (10 per page) to collect this many. |
start | number | No | Starting offset (0-indexed) for pagination. |
exactSearch | boolean | No | When true (default), the keyword is wrapped in double quotes for an exact-phrase match. Set to false for a broader search that also matches individual terms. |
filters | object | No | Optional filters to narrow down search results |
Example
{
"accountId": "acc_12345",
"keywords": "",
"count": 10,
"start": 0,
"exactSearch": true,
"filters": {
"sortBy": "example_value",
"datePosted": [
"2024-01-15"
],
"contentType": [
"default"
],
"postedBy": [
"example_value"
],
"fromMember": [
"example_value"
],
"fromOrganization": [
"example_value"
],
"mentionsMember": [
"example_value"
],
"mentionsOrganization": [
"example_value"
],
"authorCompany": [
"Acme Inc"
],
"authorIndustry": [
"Technology"
],
"authorJobTitle": [
"Senior Developer"
]
}
}Responses
| Status | Description |
|---|---|
| 200 | Posts retrieved successfully |
| 400 | Bad Request - Invalid request parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 500 | Internal Server Error - Failed to get LinkedIn credentials or search failed |
200 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
posts | array | |
count | number | Number of posts returned in this response |
totalCount | number | Total number of matching results available on LinkedIn (may be 0 if unknown) |
200 Example
{
"success": true,
"posts": [
{
"activityUrn": "urn:li:ugcPost:7431688584019111936",
"postUrl": "https://www.linkedin.com/feed/update/urn:li:ugcPost:7431688584019111936/",
"author": {
"profileId": "shiv-pandya-2ab25817",
"profileUrl": "https://www.linkedin.com/in/shiv-pandya-2ab25817/",
"name": "Shiv Pandya",
"headline": "Business Head- Kashyap Solar (Renewable Energy)",
"profilePicture": "",
"connectionDegree": "2nd",
"isVerified": false,
"isPremium": false
},
"content": "AI (Artificial intelligence) is rapidly transforming major industries...",
"timestamp": "1d",
"visibility": "public",
"engagement": {
"reactions": 12,
"comments": 2,
"reposts": 0
},
"hashtags": [
"#solar",
"#AI",
"#power"
],
"isPeopleUpdate": false,
"isArticle": false,
"canComment": true
}
],
"count": 3,
"totalCount": 0
}400 Response Parameters
| Name | Type | Description |
|---|---|---|
success | boolean | |
error | object |
400 Example
{
"success": false,
"error": {
"issues": [
{
"code": "invalid_type",
"expected": "string",
"received": "undefined",
"path": [
"keywords"
],
"message": "Required"
}
],
"name": "ZodError"
}
}401 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "Unauthorized - Invalid credentials"
}500 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
500 Example
{
"error": "Failed to search posts",
"success": false
}Get group details
Retrieve detailed information about a specific LinkedIn group including full description, rules, member count, activity level, and admin information.
Search geo locations
Search for LinkedIn geo location IDs by place name. Use this endpoint to find location IDs that can be used as filters in other search endpoints (jobs, companies, people). Returns matching cities, regions, and countries. Rate limit: no per-account search quota is enforced on this lookup — only the general 30-calls-per-minute velocity limit. Resolve an id once and reuse it rather than looking it up on every request.
