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

InputWhat it isWhere to get it
keywords
optional
Text. Words to search for.You write it.
sortBy
optional
One of: relevance, date. Order (default relevance).You write it.
datePosted
optional
One of: past_day, past_week, past_month. How recent.You write it.
contentType
optional
One of: videos, images, live_videos, collaborative_articles, documents, jobs. Only posts with this kind of content.You write it.
postedBy
optional
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 (optional): a list (text). People: ids from lookup_search_ids type PEOPLE.
  • company (optional): a list (text). Company pages: ids from lookup_search_ids type COMPANY.
  • me (optional): true or false.
  • firstConnections (optional): true or false.
  • peopleYouFollow (optional): true or false.
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.
mentioning
optional
A search filter id. Posts that mention these people or company pages.
What goes inside
  • member (optional): a list (text). People: ids from lookup_search_ids type PEOPLE.
  • company (optional): a list (text). Company pages: ids from lookup_search_ids type COMPANY.
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.
author
optional
A search filter id. Who the author is: their industry, their company, or words in their headline.
What goes inside
  • industry (optional): a list (text). Ids from lookup_search_ids type INDUSTRY.
  • company (optional): a list (text). Ids from lookup_search_ids type COMPANY.
  • keywords (optional): text. Words in the author's headline.
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.
limit
optional
A number, 1 to 49. How many to return (1–49, default 10).You write it.
cursor
optional
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.
connectionId
optional
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:

MethodPOST
URLhttps://api.heyreagent.com/v1/actions/search_linkedin_posts
Send HeadersOn. Name Authorization, Value Bearer YOUR_KEY
Send BodyOn. 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:

returnednumber
nextCursorA cursor. Other actions take it.
results[].typePOST
results[].idA post id. Other actions take it.
results[].socialIdA post social id. Other actions take it.
results[].shareUrlA post link. Other actions take it.
results[].titlestring
results[].textstring
results[].datestring
results[].parsedDatetimestring
results[].reactionCounternumber
results[].commentCounternumber
results[].repostCounternumber
results[].impressionsCounternumber
results[].userReactedLIKE | PRAISE | APPRECIATION | EMPATHY | INTEREST | ENTERTAINMENT
results[].isRepostboolean
results[].repostIdstring
results[].repostParsedDatetimestring

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

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.