# Searching for posts

To search for posts on LinkedIn, include the st.searchPosts action in your workflow. Supports keyword search, sorting, date posted, content type, author, and mention filters.

To search for posts in LinkedIn, you need to include [`st.searchPosts`](/docs/action-st-search-posts) 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"
      },
      "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, and one array can mix every form:

**Workflow:**

```json
{
  "actionType": "st.searchPosts",
  "term": "climate tech",
  "limit": 5,
  "filter": {
    "fromMembers": [
      "Bill Gates",
      { "name": "John Doe" },
      { "name": "Example Person", "urn": "urn:li:member:123456789" },
      {
        "name": "Another Person",
        "personHashedUrl": "https://www.linkedin.com/in/ACoAAAKKvC4BR-qLHi0BnO-dJ8CP81tLsY0kKyc"
      }
    ],
    "mentioningCompanies": [
      "Microsoft",
      { "name": "Example Company", "urn": "urn:li:organization:1234567" },
      {
        "name": "Another Company",
        "companyHashedUrl": "https://www.linkedin.com/company/12345678"
      }
    ],
    "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](/faq/what-are-hashed-url-and-public-url) URL Linked API returned to you as `personHashedUrl` / `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`](/docs/action-st-search-posts).

## 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`](/docs/action-st-do-for-posts) action. Search results carry no `urn` on their `author` and `reposter` – nest [`st.openPost`](/docs/action-st-open-post) under it when you need one.

> This page provides examples of [workflows](/docs/building-workflows) and their [completions](/docs/executing-workflows). For detailed documentation on constraints, parameters, and possible results of specific actions, always refer to the corresponding [action documentation pages](/docs/actions-overview).
