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:

json
{
  "actionType": "st.searchPosts",
  "term": "climate tech",
  "limit": 2,
  "filter": {
    "sort": "latest",
    "datePosted": "pastWeek",
    "contentType": "images",
    "postedBy": ["peopleYouFollow"]
  }
}

Completion:

json
{
  "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",
        "viewerState": { "connectionDegree": "2nd" }
      },
      "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,
      "viewerState": { "reaction": "like", "isOwn": false }
    },
    {
      "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,
      "viewerState": { "reaction": null, "isOwn": false }
    }
  ]
}

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:

Workflow:

json
{
  "actionType": "st.searchPosts",
  "term": "climate tech",
  "limit": 5,
  "filter": {
    "fromMembers": [
      "Bill Gates",
      { "name": "Example Person", "id": "urn:li:member:123456789" },
      { "name": "Another Person", "id": "https://www.linkedin.com/in/another-person" }
    ],
    "mentioningCompanies": [
      "Microsoft",
      { "name": "Example Company", "id": "https://www.linkedin.com/company/example-company" }
    ],
    "authorIndustries": ["Software Development"]
  }
}

Each entry is a name, or a name with an id – any identifier of the person or company: its URN or its LinkedIn URL, public or hashed. A name alone can match a namesake; with id the filter applies to exactly that person or company, and when it cannot, the action fails with filterNotApplied rather than filtering by somebody else.

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.doForPosts action. Search results carry no urn on their author and reposter – nest st.openPost under 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.