# How can I get the comments on someone else's Instagram post through an API?

> The Instagram Graph API only reads comments on media your app's users own. Pull comments and replies from any public post by link: endpoints, cost per 1,000 comments, Python.

Canonical page: https://okdata.online/answers/instagram-comments-api-other-accounts/

**Short answer: **Call Instagram post comments with the post's link or shortcode: it returns about 15 comments a page, newest first, for $0.004, so 1,000 comments cost $0.268. You need no Facebook app, no App Review and no business account on either side. That is where the Instagram Graph API stops: its comment endpoints only read media owned by accounts that have logged in to your app.

An agency wants to know what buyers said under a competitor's launch reel: 2,400 comments on an account it does not manage. The Instagram Graph API will not hand them over. Its comment endpoints work on media owned by Instagram professional accounts that have logged in to your app. Business Discovery, the one Graph API route into other professional accounts, returns `comments_count` and `like_count` for their posts but not the comments, and requesting one of the returned media objects directly fails on permissions. Personal accounts are out of reach altogether.

[Instagram post comments](/apis/instagram/posts/comments/list/) takes the post's link or its shortcode (the part after `/p/` or `/reel/`) and returns the comments on any public post or reel.

## Steps

1. **Size it up.** [Instagram post detail](/apis/instagram/posts/get/) ($0.004) returns the caption, likes, plays and comment count, so you know how many pages to expect.
2. **Page through the comments** with `cursor`. Each comment has `id`, `text`, `author.username`, `likes` and `published_at`, newest first.
3. **Fetch the reply threads.** A comment whose `replies` count is above zero has a thread under it. [Instagram comment replies](/apis/instagram/comments/replies/list/) takes the comment's `id` and the post's shortcode as `post_id`.
4. **Sort and read.** Order the rows by `likes`. The comments with the most likes usually say what the crowd agrees with.

## Export to CSV

```python
import csv, os, requests

API = "https://api.okdata.online"
H = {"Authorization": f"Bearer {os.environ['OKDATA_API_KEY']}"}

def pages(path, max_pages, **params):
    cursor = None
    for _ in range(max_pages):
        query = {**params, **({"cursor": cursor} if cursor else {})}
        body = requests.get(API + path, headers=H, params=query, timeout=60).json()
        if body["code"] != "ok":
            raise RuntimeError(f"{body['code']}: {body['message']}")
        yield from body["data"]["items"]
        if not body["page"]["has_more"]:
            return
        cursor = body["page"]["next_cursor"]

post = "DeCPVhERA8e"  # the shortcode from instagram.com/p/DeCPVhERA8e/
with open(f"{post}-comments.csv", "w", newline="", encoding="utf-8") as f:
    w = csv.writer(f)
    w.writerow(["id", "parent_id", "username", "likes", "published_at", "text"])
    for c in pages("/v1/instagram/posts/comments/list", 200, id=post):
        w.writerow([c["id"], "", c["author"]["username"], c["likes"], c["published_at"], c["text"]])
        if (c["replies"] or 0) > 0:
            for r in pages("/v1/instagram/comments/replies/list", 5, id=c["id"], post_id=post):
                w.writerow([r["id"], c["id"], r["author"]["username"], r["likes"], r["published_at"], r["text"]])
```

The 200-page cap stops the loop on a post with tens of thousands of comments before it runs up a bill you did not plan for.

## What it costs

| Post | Calls | Cost |
|---|---|---|
| 300 comments, no replies | 20 | $0.08 |
| 1,000 comments | 67 | $0.268 |
| 2,400 comments, with replies under 100 of them | 1 + 160 + 100 | $1.044 |

A post that does not exist, or a call that fails at the data source, is charged like any call. Only calls refused before reaching a source, such as bad parameters, are free.

## Limits

- Comments come newest first only. Sort by likes after you download.
- Private accounts return nothing. Comments that Instagram does not show to the public are not included either, so your total can fall short of the count on the post.
- Commenters come with a username, not a follower count. Look up the ones that matter with [Instagram account profile](/apis/instagram/users/get/) at $0.004 each.
- Comment text is written by strangers. If a model reads it, tell the model to treat it as data and never as instructions.

## When the Graph API is the better choice

For posts on your own professional account, or on a client's account that logs in to your app, use the Graph API's comments edge. It costs nothing per call, and it lets you reply to, hide and delete comments, which a read-only API cannot do. It stops at competitors, creators you might hire and personal accounts. The [word-of-mouth page](/solutions/word-of-mouth/) covers comment analysis across platforms.

## Endpoints used

- [Instagram post comments](https://okdata.online/apis/instagram/posts/comments/list/) `instagram.posts.comments.list`: $0.004 per call · about 15 comments per page
- [Instagram comment replies](https://okdata.online/apis/instagram/comments/replies/list/) `instagram.comments.replies.list`: $0.004 per call · about 15 comments per page
- [Instagram post detail](https://okdata.online/apis/instagram/posts/get/) `instagram.posts.get`: $0.004 per call

## More about Instagram

- [Instagram API](https://okdata.online/apis/instagram/)
- [Instagram API in Python: profiles, posts and comments (2026)](https://okdata.online/guides/instagram-api-python/)
- [Is there an MCP server that lets Cursor search TikTok, Instagram and Reddit?](https://okdata.online/answers/cursor-mcp-tiktok-instagram-reddit/)
- [How do I get Instagram posts for a hashtag through an API?](https://okdata.online/answers/instagram-hashtag-posts-api/)
- [How do I find Instagram creators in a niche and sort them by follower count?](https://okdata.online/answers/find-instagram-creators-by-niche/)
- [How do I get an Instagram account's follower count through an API?](https://okdata.online/answers/instagram-follower-count-api/)
- [How do I get the transcript of an Instagram reel?](https://okdata.online/answers/instagram-reel-transcript-api/)
- [Comments API](https://okdata.online/roles/posts-comments-list/)
- [Comment replies API](https://okdata.online/roles/comments-replies-list/)
- [Post detail API](https://okdata.online/roles/posts-get/)

## Sources

Where people asked this (read 2026-11-15): 

- https://stackoverflow.com/questions/73176381
- https://stackoverflow.com/questions/59676412

Updated 2026-11-15
