LinkedIn post search API
  1. Docs
  2. LinkedIn
  3. LinkedIn post search API

LinkedIn post search API

Public LinkedIn posts and Pulse articles that a web search has indexed for a query (DuckDuckGo's results, not Google's), best effort and not a complete...

GET /v1/linkedin/search/posts

GET /v1/linkedin/search/posts

Public LinkedIn posts and Pulse articles that a web search has indexed for a query (DuckDuckGo's results, not Google's), best effort and not a complete search (LinkedIn's own search needs a login). The cursor is the next results page and cannot go past 11. Each result is read like linkedin/post for the full text, author, date and counts (enrich, on by default; a post LinkedIn no longer shows is dropped). date_posted takes day, week, month or year. When the search provider asks for human verification on every try the call fails and can be retried.

  • Cost: 1 credit
  • Cache: Results are kept up to 30 days; send max_age_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
querystringyesKeyword or phrase to look for in public LinkedIn posts. Also accepted as keyword, q.
date_postedstringnoOnly posts found in this window. One of day, week, month, year. Also accepted values: last-hour for hour, last-day for day, last-week for week, last-month for month, last-year for year.
enrichbooleannoRead each post for its full text, author, date and counts (on by default). Off returns only what the search result states, much cheaper and faster. Default true.

Every request also accepts:

  • cursor: the cursor from the previous page (Pagination).
  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).

Example request#

Set your key in the environment first (see Authentication).

1curl -G "https://api.socialscrape.dev/v1/linkedin/search/posts" \2  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3  --data-urlencode "query=customer success playbook" \4  --data-urlencode "enrich=false"

Example response#

This is a sample from a recorded response, lists and long text are shortened. Status 200.

200 OKSample response
1{2  "ok": true,3  "credits_charged": 1,4  "credits_remaining": 4999,5  "cached": false,6  "cached_at": null,7  "request_id": "req_d5c387b52d788e5519b2207e",8  "data": {9    "object": "list",10    "items": [11      {12        "object": "post",13        "platform": "linkedin",14        "id": "customer-success-playbooks-what-why-matter-how-build-one-ben-hong-agvwf",15        "url": "https://www.linkedin.com/pulse/customer-success-playbooks-what-why-matter-how-build-one-ben-hong-agvwf",16        "type": "link",17        "author": null,18        "title": "Customer Success Playbooks: What They Are, Why They Matter ... - LinkedIn",19        "text": "A Customer Success playbook is a structured, repeatable process that guides how your team engages with customers at critical points in the journey.",20        "published_at": null,21        "duration_seconds": null,22        "language": null,23        "hashtags": null,24        "mentions": null,25        "stats": {26          "views": null,27          "likes": null,28          "comments": null,29          "shares": null,30          "saves": null,31          "dislikes": null32        },33        "media": {34          "thumbnail_url": null,35          "video_url": null,36          "audio_url": null,37          "image_urls": null,38          "width": null,39          "height": null40        },41        "song": null,42        "location": null,43        "is_pinned": null,44        "is_sponsored": null,45        "extra": {46          "enriched": false,47          "search_position": 1,48          "source": "duckduckgo"49        }50      },51      {52        "object": "post",53        "platform": "linkedin",54        "id": "building-customer-success-playbook-from-scratch-anirudh-kumar-xxr9c",55        "url": "https://www.linkedin.com/pulse/building-customer-success-playbook-from-scratch-anirudh-kumar-xxr9c",56        "type": "link",57        "author": null,58        "title": "Building a Customer Success Playbook From Scratch",59        "text": "If you've ever been asked to \"build a Customer Success playbook,\" you probably did what every CSM, leader, or founder does: You opened a blank Google Doc. Stared at it. Considered changing ...",60        "published_at": null,61        "duration_seconds": null,62        "language": null,63        "hashtags": null,64        "mentions": null,65        "stats": {66          "views": null,67          "likes": null,68          "comments": null,69          "shares": null,70          "saves": null,71          "dislikes": null72        },73        "media": {74          "thumbnail_url": null,75          "video_url": null,76          "audio_url": null,77          "image_urls": null,78          "width": null,79          "height": null80        },81        "song": null,82        "location": null,83        "is_pinned": null,84        "is_sponsored": null,85        "extra": {86          "enriched": false,87          "search_position": 2,88          "source": "duckduckgo"89        }90      }91    ],92    "cursor": "eyJwIjoyLCJmIjp7InEiOiIoc2l0ZTpsaW5rZWRpbi5jb20vcG9zdHMgT1Igc2l0ZTpsaW5rZWRpbi5jb20vZmVlZC91cGRhdGUgT1Igc2l0ZTpsaW5rZWRpbi5jb20vcHVsc2UpIGN1c3RvbWVyIHN1Y2Nlc3MgcGxheWJvb2siLCJzIjoiMTAiLCJuZXh0UGFyYW1zIjoiIiwidiI6ImwiLCJvIjoianNvbiIsImRjIjoi...",93    "has_more": true,94    "parent": null95  },96  "cursor": "eyJwIjoyLCJmIjp7InEiOiIoc2l0ZTpsaW5rZWRpbi5jb20vcG9zdHMgT1Igc2l0ZTpsaW5rZWRpbi5jb20vZmVlZC91cGRhdGUgT1Igc2l0ZTpsaW5rZWRpbi5jb20vcHVsc2UpIGN1c3RvbWVyIHN1Y2Nlc3MgcGxheWJvb2siLCJzIjoiMTAiLCJuZXh0UGFyYW1zIjoiIiwidiI6ImwiLCJvIjoianNvbiIsImRjIjoi...",97  "has_more": true98}

Response#

A list of Post objects in data.items, with data.cursor and data.has_more.

See Data models for every field. The envelope around data is described in Responses.

Errors#

Failures are free: credits_charged is 0. Branch on error.code, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.
upstream_blocked503yesThe platform blocked this fetch; retry (a fresh exit is used).

Every request can also fail with the account and platform errors listed on the Errors page.

Example error:

1{2  "ok": false,3  "error": {4    "code": "upstream_blocked",5    "message": "The platform blocked this fetch; retry (a fresh exit is used).",6    "retryable": true7  },8  "credits_charged": 0,9  "request_id": "req_eb8db97620aa2c1b5313da19"10}