Searching for posts
To search for posts in LinkedIn, you need to include st.searchPosts action in your workflow. It runs LinkedIn's content search on your own account and returns the results as structured JSON. Here's an example:
Workflow:
{
"actionType": "st.searchPosts",
"term": "climate tech",
"limit": 2,
"filter": {
"sort": "latest",
"datePosted": "pastWeek",
"contentType": "images",
"postedBy": ["peopleYouFollow"]
}
}Completion:
{
"actionType": "st.searchPosts",
"success": true,
"data": [
{
"url": "https://www.linkedin.com/feed/update/urn:li:activity:1234567890123456789",
"activityUrn": "urn:li:activity:1234567890123456789",
"time": "2023-01-02T12:30:00Z",
"type": "original",
"author": {
"type": "person",
"name": "Example Person",
"profileUrl": "https://www.linkedin.com/in/example-person",
"headline": "Product Marketing Lead"
},
"reposter": null,
"text": "Check out our latest product launch!",
"repostText": null,
"hashtags": ["product", "launch"],
"mentions": ["https://www.linkedin.com/company/example-company"],
"externalLinks": ["https://example.com/launch"],
"images": ["https://static.linkedin.com/image1.jpg"],
"documentSlides": [],
"hasVideo": false,
"videoThumbnail": null,
"hasPoll": false,
"reactionsCount": 27,
"commentsCount": 8,
"repostsCount": 12
},
{
"url": "https://www.linkedin.com/feed/update/urn:li:activity:2345678901234567890",
"activityUrn": "urn:li:activity:2345678901234567890",
"time": "2023-01-01T09:15:00Z",
"type": "repost",
"author": {
"type": "company",
"name": "Example Company",
"companyUrl": "https://www.linkedin.com/company/example-company"
},
"reposter": {
"type": "person",
"name": "Example Reposter",
"profileUrl": "https://www.linkedin.com/in/example-reposter",
"headline": null
},
"text": "Original post content about the webinar.",
"repostText": "A useful summary for anyone planning a launch.",
"hashtags": [],
"mentions": [],
"externalLinks": [],
"images": [],
"documentSlides": [],
"hasVideo": true,
"videoThumbnail": "https://media.licdn.com/dms/image/video-cover.jpg",
"hasPoll": false,
"reactionsCount": 6,
"commentsCount": 0,
"repostsCount": 1
}
]
}Narrowing the search by a person or a company
fromMembers and fromCompanies keep only posts published by the people or companies you list, mentioningMembers and mentioningCompanies keep only posts that mention them, and authorCompanies keeps only posts whose author works at them. Each entry is either a plain name string or an object with a name and an optional identifier:
Workflow:
{
"actionType": "st.searchPosts",
"term": "climate tech",
"limit": 5,
"filter": {
"fromMembers": [
"Bill Gates",
{ "name": "John Doe", "urn": "urn:li:member:123456789" }
],
"authorIndustries": ["Software Development"]
}
}A name on its own does not guarantee the right person or company. LinkedIn's filter panel accepts typed text and nothing else, so with a bare name the entry that gets picked is whichever suggestion LinkedIn ranked first – which may be a namesake. Pass
urn, or the hashed URL Linked API returned to you aspersonHashedUrl/companyHashedUrl, to pin the exact one.
An identifier you supply is matched, never approximated – rather than filtering by a namesake, the action fails with
filterIdentityMismatch.
How many posts come back
limit defaults to 10 and accepts up to 100, or up to 20 when child actions are attached. A value above the applicable maximum is rejected when the workflow is submitted. A search may return fewer posts than limit, because how many results come back depends on what LinkedIn loads for that account on that search.
LinkedIn widens a narrow query on its own and returns loosely related posts, so a non-empty result does not mean your term matched. Check the returned posts against your own criteria when an exact match matters.
💡 If you want to perform actions on posts from search results, use
st.doForPostsaction. Search results carry nournon theirauthorandreposter– nestst.openPostunder it when you need one.
This page provides examples of workflows and their completions. For detailed documentation on constraints, parameters, and possible results of specific actions, always refer to the corresponding action documentation pages.