SocialHolmes

How to get Instagram comments with an API

3 min read Revised September 01, 2026

Posts are published in English only. The rest of the site reads in ten languages; these do not, because a translated archive is one nobody keeps current.

Comments are the most requested thing we serve and the one people most often build subtly wrong. Here is the whole flow, then the three problems that show up a week later.

The flow

POST the shortcode and a limit
One call to the comments endpoint. It answers immediately with a 202 and a run id, not with comments — reading a page takes seconds rather than milliseconds, and an API that blocked for that long would be a worse API.
Poll the run, or register a webhook once
Polling is fine for a script. Webhooks are what you want on a schedule: a polling loop held open across thousands of runs is a lot of connections doing nothing.
Read typed JSON
Comment id, text, author username and id, timestamp, like count, and reply count where the platform exposes one. No HTML to parse and no platform-shaped envelope to unwrap. Replies are their own endpoint, because a thread's replies page independently.

Trap one: the counts will not match

The count shown on a post and the number you can retrieve rarely agree, and the gap is not a bug. Instagram hides comments from blocked accounts, filters some by region, collapses others behind moderation, and counts replies in the total on some surfaces and not others. Build for the number you got rather than the number displayed. A pipeline that retries until they match will retry forever.

Trap two: pagination is not stable

Ordering shifts while you page, because new comments arrive and moderation moves things. Ask for three pages of a busy post and you will get some duplicates and miss a few. Deduplicate on comment id rather than assuming pages are disjoint. For a genuinely complete snapshot of a busy thread, ask for it in one larger request rather than several small ones.

Trap three: this is personal data

Comment authors are people. The comments are public, but a stored database of who said what carries obligations in most jurisdictions: a lawful basis, a retention period, and an answer if somebody asks what you hold. Decide those before you build the table. Most analysis needs the text and the timestamp far more than a permanent record of the username, and storing less is the cheapest compliance decision available.

What it costs

$0.50
per 1,000 comments delivered
40
billed when you asked 400 and got 40
$0
for a post with comments turned off
4
platforms on the same route and shape

You set the limit and are billed for what actually comes back. TikTok, YouTube and Snapchat use the same route, the same polling loop and the same response structure — a different platform in the path.

Questions people ask

Can I get Instagram comments without logging in?
Yes, through a third-party API. Instagram's own Graph API only reaches comments on accounts that have authorised your app, so it is not a route to comments on posts you do not control.
Why do I get fewer comments than the post says it has?
Because the displayed count includes things you cannot retrieve — comments hidden from blocked accounts, region-filtered, or collapsed by moderation — and counts replies inconsistently across surfaces. Build for the number you got.
How do I get replies to a comment?
A separate endpoint. Replies page independently of the parent thread, and folding them into the parent would make the page size unpredictable.
Is storing Instagram comments GDPR-relevant?
Usually yes. Public does not mean unregulated: a stored record of who said what is personal data, and you need a lawful basis, a retention period, and an answer to a subject access request. Storing the text without the username is often enough for the analysis and much cheaper to defend.

Try it on your own targets

The only comparison that settles anything is your own. A new account gets 1,000 credits, needs no card, and runs on the same endpoints and rate as a paying one.