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_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
query | string | yes | Keyword or phrase to look for in public LinkedIn posts. Also accepted as keyword, q. |
date_posted | string | no | Only 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. |
enrich | boolean | no | Read 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:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.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"1import os2import requests34params = {5 "query": "customer success playbook",6 "enrich": "false",7}8res = requests.get(9 "https://api.socialscrape.dev/v1/linkedin/search/posts",10 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},11 params=params,12)13body = res.json()1415if body["ok"]:16 print(body["data"])17else:18 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/linkedin/search/posts");2url.search = new URLSearchParams({3 "query": "customer success playbook",4 "enrich": "false"5}).toString();6const res = await fetch(url, {7 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },8});9const body = await res.json();1011if (body.ok) {12 console.log(body.data);13} else {14 console.error(body.error.code, body.error.message);15}1{2 "nodes": [3 {4 "name": "SocialScrape LinkedIn post search",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/linkedin/search/posts",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "query",19 "value": "customer success playbook"20 },21 {22 "name": "enrich",23 "value": "false"24 }25 ]26 },27 "sendHeaders": true,28 "headerParameters": {29 "parameters": [30 {31 "name": "x-api-key",32 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"33 }34 ]35 }36 }37 }38 ],39 "connections": {}40}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
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.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
not_found | 404 | no | The platform says this profile, post or item does not exist. |
upstream_blocked | 503 | yes | The 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}Related endpoints#
- LinkedIn Ad Library search (
GET /v1/linkedin/ad-library/search) - LinkedIn Ad Library ad details (
GET /v1/linkedin/ad-library/ad) - LinkedIn public person profile (
GET /v1/linkedin/profile) - LinkedIn company page (
GET /v1/linkedin/company) - LinkedIn company posts (
GET /v1/linkedin/company/posts) - LinkedIn public post (
GET /v1/linkedin/post) - LinkedIn post video transcript (
GET /v1/linkedin/post/transcript)