Introducing the Instagram APIRead more →

Cosmos Search API. Saved pictures, videos and products matching your search.

Saved pictures, videos and products by keyword. We handle the proxies, blocks and platform changes.

In your agent: Cosmos MCP server →

Cosmos Search API at a glance

Searches Cosmos's public elements by keyword, a page at a time, by best match, newest, oldest or popular. Filter by kind (pictures, videos, links, notes or shop products) and colour. Each element has its files, when it was saved and by whom, the page it came from and its creator there, and a product's price and stock.

GET /v1/cosmos/search_posts

Read the API reference
  • 1 credit per page, $0.75–$1.97 per 1,000 pages
  • 25 typed fields null when unknown
  • 50 saved pictures, videos and products per page, Cosmos's relevance order (its search ranking)
  • query is all it needs, e.g. architecture

Send one request. Get up to 50 saved pictures, videos and products back.

Copy the request in your language, or hand it to your agent. Sign up for an API key and your first 100 credits are free.

$ npm install socialtap
query = architecture
GET /v1/cosmos/search_postsTry in
// Node 18+: save this as app.mjs (an ES module) and run: node app.mjs
const params = new URLSearchParams({
  query: "architecture",
});
const res = await fetch(`https://socialtap.dev/v1/cosmos/search_posts?${params}`, {
  headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, page, meta } = body;
console.log(data, meta.credits_charged);
200 OK · GET https://socialtap.dev/v1/cosmos/search_postsLong arrays and strings are shortened here. Real responses are complete.Docs

One schema on 24 platforms.

The response reference lists every field, its type and when it is null. See the full schema.

  • Null means unknown

    A field Cosmos doesn't show is null, never zero or an empty string, so a real zero always means zero.

  • What it accepts

    Words to search Cosmos's elements for, matched by meaning, so related posts match too; case doesn't matter.

  • Write one parser

    Cosmos, TikTok, Instagram and 21 more platforms answer in these fields, so the code that reads one reads them all.

platformstring
Platform ID (tiktok, youtube, …).
In the example "cosmos"
idstring
Platform-native post ID (string; Instagram shortcode, Reddit with its t3_ prefix).
In the example "547956585"
urlstring
Canonical post URL.
In the example "https://www.cosmos.so/e/547956585"
typestring
Normalized content shape. New values may be added; treat unknown values as other.
In the example "carousel"
platform_typestring
The platform's own product label, lowercase (reel, short, story, live, tweet, …).
In the example "media"
titlestring
Headline (YouTube title, Reddit title); null on caption-only platforms.
In the example null
textstring
Caption, description or body as plain text.
In the example null
link_urlstring
The page the post links to: a link post's target, a pin's destination, or the page its link card or link sticker opens; null when it links to none.
In the example "https://www.instagram.com/p/DK2wZxvMsbf/?igsh=MW9ubmc3NzRucHBkNg=="

What teams build with the Cosmos Search API.

  • Build a moodboard from a keyword

    Search a theme such as brutalist interiors and keep media[].url, width and height of each result, with link_url and the creator's source_author to credit the original.

  • Find products in a colour

    Set kind to product and color to a hex colour, and read each result's name, brand, price and stock from platform_specific.cosmos.product.

  • Watch what people save on a topic

    Sort by newest with since set to your last run, to collect the elements saved since then that match your words.

Good to know before you build.

  • Cosmos matches by meaning, so a rare or misspelled query still returns related elements rather than an empty page.
  • Cosmos records no saver for some elements: author then has every field null, and platform_specific.cosmos.source_author still names the original creator when Cosmos knows it.
  • published_at is when the element was saved to Cosmos, which newest and oldest sort by, not when it was first posted elsewhere.
  • A page can hold fewer results than limit while the walk goes on: Cosmos leaves out elements it no longer shows.

1 credit per page. Failed requests are free.

Buy credits once and spend them on any endpoint, on any platform.

SourcePrice per successful pagePer 1,000 pages
Platform API api1 credit$0.75–$1.97
Public page page1 credit$0.75–$1.97
  • Cache hits are free.
  • Credits from packs and top-ups never expire.
  • A monthly plan's credits are spent first, and what is left of them ends at each renewal.
  • Prices exclude tax: sales tax is added at checkout where it applies.
  • Outside the US, plans and packs are sold to businesses: checkout asks for your VAT, GST or other business tax ID.

Questions about the Cosmos Search API.

More in the API reference.

Can I search Cosmos by colour?
Yes. Send color as a hex colour such as #c0392b with any query, alone or with a kind, and Cosmos returns the matching elements in that colour.
Can I paste a link from Cosmos's search?
Yes. Send a cosmos.so/search/elements or /search/products link as query: its words, kind, order and colour are read from it.
Does it search accounts or collections?
No. It searches elements; the Cosmos Collection Search API finds collections by keyword. Logged out, Cosmos's account search asks to sign in, and the Cosmos Profile API reads an account by its username.
How much does the Cosmos Search API cost?
A page of up to 50 saved pictures, videos and products costs 1 credit. Every successful page is charged, empty pages included. SocialTap credits cost $0.75–$1.97 per 1,000, depending on the plan or pack.
How do I get the next page?
Repeat the same request with cursor set to page.next_cursor from the previous response, keeping the other parameters. When page.has_more is false there are no more pages. Cursors expire after 24 hours.

Try it with your own search.

Type it in the playground, or copy the request into your code.

100free credits
  • No credit card
  • Failed requests are free
  • Works on all 310 endpoints
Start for free Read the docs