Search posts

Search public professional posts by keyword and filters. The request is a JSON body, not query parameters. query supports quoted phrases, AND/OR/NOT and parentheses, with a hard ceiling of 5 boolean operators that comes from the underlying search - a 6th is refused with 400 rather than silently matching nothing. Filters cover recency (postedWithin, postedAfter), attachment kind (contentType), the author (authorProfiles, authorCompanies, authorJobTitle, authorIndustries) and mentions (mentionsProfiles, mentionsCompanies); every filter is validated against a closed list of values, so a typo is a free 400 instead of a billed page that quietly ignored it. A filter whose effect we could not confirm is refused with a free 400 rather than offered: an unrecognised filter is silently ignored by the underlying search, which would return a plausible but completely unfiltered page you paid for. sortBy has NO default: omit it and the underlying search applies its own ordering, which the response reports as sort: null. Pages are walked with an opaque cursor - author searches included - and one query is exhausted after a few hundred results, so reach further by splitting it by date window or by author. total gives the number of matching posts the source reports: an estimate that moves between pages, so walk until cursor is null. Billing is a flat 1 credit per call whatever comes back, zero results included; a 400, a 402 and a 503 cost nothing.

post/api/v1/posts/search

Request

  • Base URL: https://api.fetchin.io
  • URL: https://api.fetchin.io/api/v1/posts/search
  • Auth: API key in header X-API-Key

Request body

querystring

The search terms. Supports quoted phrases, AND / OR / NOT, parentheses with nesting up to 5 levels, and hashtag terms. At most 5 boolean operators - this is a limit of the underlying search, and a 6th is refused with 400 rather than silently matching nothing, so split the query into several searches and combine the results. At most 20 quoted phrases. A quoted phrase is matched as words, not verbatim: short common words inside the quotes are dropped and other forms of a word match. Curly quotes, lowercase operators, single-quote delimiters and a bare & are normalised silently, and the interpreted query is echoed back as the response's query. Required unless authorProfiles or authorCompanies is set.

sortBy'relevance' | 'date'

How to order the results. No default: omit it and the underlying search applies its own ordering, which the response reports as sort: null. date is newest first. date cannot be combined with a hashtag term in query (400). A query that matches too many posts does not sort by date: the underlying search then returns a handful of old, unrelated posts (or none) and no cursor, whatever the postedWithin window. Narrow it (more AND, fewer OR alternatives) or split it into several searches.

postedWithin'24h' | 'week' | 'month'

Keep only posts published within this window. Applied by the search itself, so it also changes which results exist.

contentTypestring[]

Keep only posts carrying one of these kinds of attachment. Values OR together.

authorProfilesstring[]

Keep only posts published by these people. 1 to 25 values, each a profile id or any profile URL containing one; a 26th is refused with 400 ('authorProfiles' must contain between 1 and 25 entries.). A slug on its own is not accepted here - resolve it with GET /api/v1/profile first. Can be sent without query to page a set of authors.

authorCompaniesstring[]

Keep only posts published by these organization pages. 1 to 10 values, each a numeric page id, a page urn, or a page URL ending in a numeric id. Can be sent without query.

mentionsProfilesstring[]

Keep only posts that mention these people. 1 to 10 values, each a profile id or any profile URL containing one. A slug on its own is not accepted here - resolve it with GET /api/v1/profile first.

mentionsCompaniesstring[]

Keep only posts that mention these organization pages. 1 to 10 numeric page ids, urns or URLs.

authorIndustriesstring[]

Keep only posts whose author works in one of these industries, as the author declares it on their own profile (not their employer's industry). Values OR together. 1 to 10 values, each an industry name such as SOFTWARE_DEVELOPMENT (any case, or written as the label, Software Development) or its numeric id. The 434 accepted values are listed on the endpoint page; anything else is refused with 400.

authorJobTitlestring

Keep only posts whose author's current title matches this free text. Matched as a phrase.

maxResultsinteger

How many results this page may return. 50 is both the default and the hard ceiling; a larger value is refused with 400 because the underlying search answers nothing at all above it. A page can return fewer results than this: results are de-duplicated by post id within the page (a 50-result request measured 49), and the last page of a walk is short by nature.

cursorstring

Opaque cursor for the next page. Pass back the cursor from the previous response, byte for byte, with the same query and filters; omit it to start a new search. A cursor issued for a different query, or any value this API did not issue, is refused with 400. Keep paging while cursor is not null.

Example request

{
  "query": "\"head of growth\" AND (saas OR fintech) NOT intern",
  "contentType": [
    "document"
  ],
  "authorProfiles": [
    "ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc"
  ],
  "authorCompanies": [
    "1035"
  ],
  "mentionsProfiles": [
    "ACoAAAEkwwAB9KEc2TrQgOLEQ-vzRyZeCDyc6DQ"
  ],
  "mentionsCompanies": [
    "1035"
  ],
  "authorIndustries": [
    "DEFENSE_AND_SPACE_MANUFACTURING"
  ],
  "authorJobTitle": "Head of Growth"
}

Response

A page of matching posts. Billed 1 credit, including when results is empty. Observed latency, not a guarantee: ~1-2 s for a small page and 4.5-7 s for a full 50-result page.

querystring nullable required

The query as it was interpreted, after normalisation - so every silent rewrite is auditable. null on an author-only search.

sort'relevance' | 'date' | 'null' nullable required

The ordering that was applied, echoed from the request. null when sortBy was omitted, meaning the underlying search used its own ordering, which we do not name.

totalinteger

How many posts the source counts for this search: an estimate, revised from one page to the next. Omitted when the source does not report one.

cursorstring nullable required

Opaque cursor for the next page, or null when this result set is exhausted - the only end-of-results signal (total is an estimate and cannot end a walk). Returned on author searches too. Pass it back unchanged with the same query and filters. Consecutive pages can repeat posts, notably on dense result sets sorted by date: de-duplicate on id. One query is exhausted after a few hundred results.

Example response

{
  "total": 378,
  "results": [
    {
      "id": "urn:li:activity:7486820978292072449",
      "entityId": "7486820978292072449",
      "shareUrn": "urn:li:ugcPost:7486820977411145728",
      "shareUrl": "https://www.linkedin.com/feed/update/urn:li:activity:7486820978292072449/",
      "url": "https://www.linkedin.com/feed/update/urn:li:activity:7486820978292072449/",
      "postedAgoShort": "3d",
      "postType": "image",
      "media": [
        {
          "type": "image"
        }
      ],
      "author": {
        "id": "ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc",
        "name": "Bill Gates",
        "url": "https://www.linkedin.com/in/williamhgates",
        "publicIdentifier": "williamhgates",
        "universalName": "microsoft",
        "followerCount": 1289,
        "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy"
      },
      "resharedPost": {
        "author": {
          "id": "ACoAAA8BYqEBCGLg_vT_ca6mMEqkpp9nVffJ3hc",
          "name": "Bill Gates",
          "url": "https://www.linkedin.com/in/williamhgates",
          "publicIdentifier": "williamhgates",
          "universalName": "microsoft",
          "followerCount": 1289,
          "headline": "Chair, Gates Foundation and Founder, Breakthrough Energy"
        },
        "media": [
          {
            "type": "image"
          }
        ]
      },
      "group": {
        "id": "4521873",
        "name": "SaaS Growth Leaders",
        "url": "https://www.linkedin.com/groups/4521873/"
      }
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.