Skip to content

Search Instagram by keyword without a login and get top posts and reels, related search terms and the topic’s total media count.

GET · POST1 credit / successful callCursor-paginatedLong-running
GEThttps://api.scrapier.io/api/v2/instagram-popular-search/Open in Playground

Send a keyword in queries. You get back matching popular posts in posts (shortcode, URL, type, caption, video URL, play count, owner), plus suggested_terms and a topic summary: title, total_media_count and description.

No session cookie is needed. Page on with cursor.

  • Find the most-watched content for a topic.
  • Discover related search terms for keyword research.
  • Gauge how big a topic is on Instagram.
Terminal window
curl -G "https://api.scrapier.io/api/v2/instagram-popular-search/" \
-H "X-API-Key: YOUR_API_KEY" \
--data-urlencode "queries=ronaldo" \
--max-time 210
NameTypeRequiredDefaultDescription
X-API-Key headerstringyes—Your API key from the dashboard.
queriesstringyese.g. ronaldoSearch keyword. Required first call. title/total_media_count/description are only populated on page 1 (SSR-only fields; null on later pages).
cursorstringno—Pagination cursor returned in the previous response's next_cursor. Pass it back unchanged to fetch the next page. When next_cursor is null, you have reached the last page.
Advanced
NameTypeDefaultDescription
use_proxybooleantrueRoute the request through Scrapier's residential proxy pool. Default: true. Leave as is unless support tells you otherwise.
raw_databooleanfalseWhen true, the response carries the full raw upstream payload(s) the scraper received (GraphQL / JSON API bodies, HTML, embedded JSON-LD -- exactly as the platform returned them) under raw_responses, in place of the formatted items. When false (default) you get the formatted output. Pagination (cursor / next_cursor) works the same in both modes.
{
"success": true,
"data": {
"query": "ronaldo",
"success": true,
"title": "Ronaldo",
"total_media_count": 110000000,
"description": {
"plain_text": "Cristiano Ronaldo was included in Portugal’s Nations League squad...",
"source_uris": [
"https://gulfnews.com/sport/football/cristiano-ronaldo-is-not-retiring..."
],
"linked_terms": []
},
"suggested_terms": [
"ronaldo jr",
"ronaldinho",
"cristiano ronaldo"
],
"posts": [
{
"id": "POLARIS_3123456789012345678",
"shortcode": "CxYzAbC123",
"url": "https://www.instagram.com/reel/CxYzAbC123/",
"type": "reel",
"caption": "Ronaldo training highlights",
"video_url": "https://scontent.cdninstagram.com/....mp4",
"play_count": 5400000,
"owner": {
"id": "173560420",
"username": "cristiano",
"is_verified": true
}
}
],
"next_cursor": "eyJ2ZXJzaW9uIjoxLCJxdWVyeSI6InJvbmFsZG8iLCJhZnRlciI6IlFWSlRSbmxSUFQwPSIsImxzZCI6IkFCQ2RlZiIsImNzcmZUb2tlbiI6IlhZWiJ9"
}
}

Sample from the live catalog; arrays trimmed to 3 items. Results are in data.posts.

FieldTypeExampleDescription
querystringronaldo—
successbooleantrue—
titlestringRonaldo—
total_media_countinteger110000000—
descriptionobject{…}—
suggested_termsarray[3 items]—
postsarray[1 item]The results.
next_cursorstringeyJ2ZXJzaW9uIjoxLCJxdWVyeSI6InJvbmFsZG8iLCJhZ…Pass back as cursor for the next page. null on the last page.
posts[].idstringPOLARIS_3123456789012345678—
posts[].shortcodestringCxYzAbC123—
posts[].urlstringhttps://www.instagram.com/reel/CxYzAbC123/—
posts[].typestringreel—
posts[].captionstringRonaldo training highlights—
posts[].video_urlstringhttps://scontent.cdninstagram.com/....mp4—
posts[].play_countinteger5400000—
posts[].ownerobject{…}—

Pass data.next_cursor back as cursor until it is null. Required inputs are ignored once a cursor is sent. Each page is one billed call. More in Pagination.

const url = "https://api.scrapier.io/api/v2/instagram-popular-search/";
let params = { queries: "ronaldo" };
const items = [];
for (let page = 0; page < 10; page++) { // each page is one billed call
const res = await fetch(`${url}?${new URLSearchParams(params)}`, {
headers: { "X-API-Key": "YOUR_API_KEY" },
signal: AbortSignal.timeout(210_000),
});
const body = await res.json();
if (!res.ok) throw new Error(body.error ?? body.detail ?? `HTTP ${res.status}`);
const data = body.data;
items.push(...(data.posts ?? []));
if (!data.next_cursor) break; // null = last page
params = { cursor: data.next_cursor };
}

Failed calls are free. Branch on the HTTP status and read the message from error (or detail). Full details in Errors.

StatusMeaningRetry?Charged?
400Bad or missing input.No — fix the paramsNo
401 / 403Missing, invalid or revoked API key.No — fix the keyNo
402Out of credits (body has balance).No — top upNo
404Unknown endpoint slug.No — check the slugNo
429 / 503Busy or throttled.Yes — after Retry-AfterNo
5xxTarget site or upstream failure, or timeout.Yes — with backoffNo
  • title, total_media_count and description are only filled on page 1. They are null on later pages.
  • The response data carries its own success field from the scraper. The outer success is what counts: an HTTP 200 with outer success: true is billed, even if the inner field says otherwise.
  • This endpoint can take several minutes. Set your client timeout to at least 210 seconds.
  • Instagram Profile Search — Search Instagram accounts by keyword and get usernames, names, follower counts and verification status.