How to scrape Instagram popular topic

Get Instagram popular topic as JSON with one request. It costs 1 credit.

Preview
The API is in early access. Ask for a key; the examples use api.socialscrape.io.

Before you start

  • An API key, sent in the x-api-key header. Keep it on your server.
  • For this endpoint you send query. The Instagram popular topic page lists every parameter.

Step 1: Send the request

GET /v1/instagram/search/popular. Pick your language; each one reads the key from SOCIALSCRAPE_API_KEY.

Step 2: Read the response

Results are in data.items. Here is what one item gives you, from a recorded sample.

Fields printed aboveSample
{
  "text": "These moves will make you SHIFTY. 🤝🎒 #basketball #sports #athlete #nba #hooper #trending #reels #viral #explore #explorepage",
  "id": "DPhCDu_jj2l",
  "author": {
    "handle": "woahhelijah"
  }
}

A field the platform does not give comes back as null. The full field list is on the endpoint page.

Step 3: Get the next page

Send the same request with the cursor you got back, until has_more is false. Each page costs its own price.

Step 4: Handle errors

Check ok, then branch on error.code and error.retryable, never on the message.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
not_found404noThe platform says this profile, post or item does not exist.

Other errors, such as unauthorized or rate_limited, are on the errors page.

With the SDK

The Python and TypeScript clients wrap all of this: typed errors, retries, and cursor paging. They are in preview and not published yet.

What it costs

1 credit. A failed request costs nothing. Add max_age_days to reuse a cached result for 0 credits. Results are kept 30 days.

Next

Questions

How do I watch Instagram popular topic for new items?

Create a monitor on this endpoint and get new items at a webhook, instead of polling. See the monitors reference.

Which language should I use?

Any. It is plain HTTP and JSON, so every language with an HTTP client works. The tabs show the same request nine ways.

Get a key.

Early access keys go to developers and agent builders first.

Get early access