LinkedIn post search API
LinkedIn’s post search by keywords, newest or most relevant first, filtered by date, content type, author, author’s company or industry.
GET /v1/linkedin/search/postsNot switched on yet5 credits per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/linkedin/search/posts?keywords=cold%20email&sort=date&date_posted=past_week",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()No bundled sample for this call. The response is a LinkedInPostSearchPage; its fields are listed below.
Parameters
| Name | Type | Description |
|---|---|---|
keywordsquery · required | string | Words to match. Example: outbound sales. |
sortquery | "relevance" | "date" | Default relevance. One of relevance, date. |
date_postedquery | "past_24h" | "past_week" | "past_month" | Only posts from this window. One of past_24h, past_week, past_month. |
content_typequery | "videos" | "images" | "articles" | "documents" | "live_videos" | Only posts with this kind of media. One of videos, images, articles, documents, live_videos. |
from_memberquery | string | Authors: profile ids (ACoAA…), comma-separated (up to 10). |
from_companyquery | string | Posted by company pages: numeric ids, comma-separated (up to 10). Example: 1035. |
author_companyquery | string | Authors who work at: numeric ids, comma-separated (up to 10). Example: 1035. |
author_industryquery | string | Authors in industry: numeric ids, comma-separated (up to 10). Example: 43. |
afterquery | string | Cursor: the previous page’s after, unchanged. |
accountquery | string | Optional: the id of a LinkedIn account you connected (POST /v1/linkedin/accounts). The read then runs as that account (what it can see, its network distance) instead of on the shared pool. Example: csn_01JDX9EXAMPLE0000000000. |
Response fields
200 with a LinkedInPostSearchPage, in LinkedIn’s own schema.org JSON-LD, with the rest of the public page beside it.
| Field | Type | Description |
|---|---|---|
total | integer | null | |
data | LinkedInSessionPost[] | |
after | string | null | Pass as after for the next page; null at the end. |
Status codes
| Status | Meaning |
|---|---|
200 | A page of posts. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | LinkedIn has no such public page, or it was removed. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | LinkedIn is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
When can I use it?
It needs a signed-in LinkedIn session. Our shared, paced pool of sessions is not switched on yet, so a call answers 503 upstream_unavailable and is never charged. It is listed so you can plan for it.
LinkedIn is a trademark of LinkedIn Corporation. We are not affiliated with or endorsed by LinkedIn.