Search LinkedIn posts (V2 - RSC endpoint with auto-pagination)
Search for LinkedIn posts using the RSC endpoint 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. Rate Limit: 300 searches per account per month (resets on the 1st of each month).
/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,"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"]}}'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. |
filters | object | No | Optional filters to narrow down search results |
Example
{
"accountId": "acc_12345",
"keywords": "",
"count": 10,
"start": 0,
"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: 300 searches per account per month (resets on the 1st of each month).
