Facebook Pixel
APILinkedIn Search

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).

POST/search/posts/v2
Authentication requiredSearch

Code 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

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
keywordsstringNoSearch keywords for post content
countnumberNoTotal number of posts to return. API will automatically paginate (10 per page) to collect this many.
startnumberNoStarting offset (0-indexed) for pagination.
filtersobjectNoOptional 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

StatusDescription
200Posts retrieved successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing API key
500Internal Server Error - Failed to get LinkedIn credentials or search failed

200 Response Parameters

NameTypeDescription
successboolean
postsarray
countnumberNumber of posts returned in this response
totalCountnumberTotal 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

NameTypeDescription
successboolean
errorobject

400 Example

{
  "success": false,
  "error": {
    "issues": [
      {
        "code": "invalid_type",
        "expected": "string",
        "received": "undefined",
        "path": [
          "keywords"
        ],
        "message": "Required"
      }
    ],
    "name": "ZodError"
  }
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "Unauthorized - Invalid credentials"
}

500 Response Parameters

NameTypeDescription
errorstring

500 Example

{
  "error": "Failed to search posts",
  "success": false
}