Docs / Search
search_linkedin_posts
Search posts on LinkedIn, with each LinkedIn filter as its own typed input.
This action only reads. It changes nothing, so it is safe to try.
What you give it
| Input | What it is | Where to get it |
|---|---|---|
keywordsoptional | Text. Words to search for. | You write it. |
sortByoptional | One of: relevance, date. Order (default relevance). | You write it. |
datePostedoptional | One of: past_day, past_week, past_month. How recent. | You write it. |
contentTypeoptional | One of: videos, images, live_videos, collaborative_articles, documents, jobs. Only posts with this kind of content. | You write it. |
postedByoptional | A search filter id. Who posted it: given people, given company pages, you, your 1st-degree connections, or people you follow.What goes inside
| member: run lookup_search_ids with type PEOPLE, and use matches[].id from its answer.company: run lookup_search_ids with type COMPANY, and use matches[].id from its answer. |
mentioningoptional | A search filter id. Posts that mention these people or company pages.What goes inside
| member: run lookup_search_ids with type PEOPLE, and use matches[].id from its answer.company: run lookup_search_ids with type COMPANY, and use matches[].id from its answer. |
authoroptional | A search filter id. Who the author is: their industry, their company, or words in their headline.What goes inside
| industry: run lookup_search_ids with type INDUSTRY, and use matches[].id from its answer.company: run lookup_search_ids with type COMPANY, and use matches[].id from its answer. |
limitoptional | A number, 1 to 49. How many to return (1–49, default 10). | You write it. |
cursoroptional | A cursor. nextCursor from the previous call, to get the next page. Keep the other arguments the same. | The nextCursor from the last answer of search_linkedin_posts. |
connectionIdoptional | A connection id. Which of your LinkedIn accounts to act from (its id from list_linkedin_accounts). Omit to use your first live one. | Run list_linkedin_accounts and use accounts[].id from its answer.15 more places to get it
|
Call it
curl -X POST https://api.heyreagent.com/v1/actions/search_linkedin_posts \
-H "Authorization: Bearer YOUR_KEY" \
-H "content-type: application/json" \
-d '{"keywords":"outbound sales"}'The same call in JavaScript
const response = await fetch("https://api.heyreagent.com/v1/actions/search_linkedin_posts", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_KEY",
"content-type": "application/json",
},
body: JSON.stringify({
"keywords": "outbound sales"
}),
});
const answer = await response.json();
console.log(answer);The same call in Python
import requests
response = requests.post(
"https://api.heyreagent.com/v1/actions/search_linkedin_posts",
headers={"Authorization": "Bearer YOUR_KEY"},
json={
"keywords": "outbound sales",
},
)
print(response.json())The same call in n8n
Add an HTTP Request node and fill it in like this:
| Method | POST |
| URL | https://api.heyreagent.com/v1/actions/search_linkedin_posts |
| Send Headers | On. Name Authorization, Value Bearer YOUR_KEY |
| Send Body | On. Body Content Type JSON, Specify Body Using JSON, then paste the body below |
{
"keywords": "outbound sales"
}Put your own key where it says YOUR_KEY. New here? Start with your first call.
What you get back
When it worked, the answer is { "ok": true, "result": { … } }. Inside result:
returned | number |
nextCursor | A cursor. Other actions take it. |
results[].type | POST |
results[].id | A post id. Other actions take it. |
results[].socialId | A post social id. Other actions take it. |
results[].shareUrl | A post link. Other actions take it. |
results[].title | string |
results[].text | string |
results[].date | string |
results[].parsedDatetime | string |
results[].reactionCounter | number |
results[].commentCounter | number |
results[].repostCounter | number |
results[].impressionsCounter | number |
results[].userReacted | LIKE | PRAISE | APPRECIATION | EMPATHY | INTEREST | ENTERTAINMENT |
results[].isRepost | boolean |
results[].repostId | string |
results[].repostParsedDatetime | string |
A field that does not apply to an answer is left out, or is null. There are 177 more fields nested inside these.
When it did not work, the answer is { "ok": false, "error": "…", "message": "…" }. What each error means.
Good to know
- At most 49 rows per call: LinkedIn's page size for this search.
- LinkedIn returns at most 1,000 rows for one search; narrow the filters to reach the rest.
In Claude or ChatGPT
Once connected, ask in your own words. The assistant sees this action as a tool with the same name, search_linkedin_posts, and the same inputs.