# 不是自己管理的 Instagram 帳號，怎麼用 API 拿到帖子下的評論？

> Instagram Graph API 只能讀授權了你 App 的帳號自己的評論。按連結拉取任意公開帖子的評論和回覆：用哪些介面、每 1,000 條多少錢，附 Python 程式碼。

網頁版：https://okdata.online/zh-hant/answers/instagram-comments-api-other-accounts/

**簡短回答：**用 Instagram 帖子評論介面，傳帖子連結或短碼就行：每頁約 15 條評論，從新到舊，每次 $0.004，1,000 條評論共 $0.268。不用建 Facebook App，不用過 App Review，你和對方都不必是商業帳號。Instagram Graph API 做不到這一點，它的評論介面只能讀授權登入了你 App 的帳號自己發的帖子。

一家代理公司想知道，競品新品釋出的那條 Reel 下面買家都說了什麼：2,400 條評論，帳號不歸他們管。Instagram Graph API 拿不到這些。它的評論介面只對授權登入了你 App 的 Instagram 專業帳號自己的帖子有效。Business Discovery 是 Graph API 裡唯一能查別人專業帳號的入口，但它只給帖子的 `comments_count` 和 `like_count`，不給評論內容；拿返回的帖子 ID 直接去查，會報權限不足。個人帳號就更查不到了。

[Instagram 帖子評論](/zh/apis/instagram/posts/comments/list/)接收帖子連結或短碼（連結裡 `/p/` 或 `/reel/` 後面那一段），任何公開帖子和 Reel 的評論都能拿。

## 步驟

1. **先看規模。** [Instagram 帖子詳情](/zh/apis/instagram/posts/get/)（$0.004）返回文案、點贊、播放和評論數，要翻多少頁心裡先有數。
2. **逐頁拉評論**，用 `cursor` 翻頁。每條評論有 `id`、`text`、`author.username`、`likes` 和 `published_at`，從新到舊排。
3. **拉樓中樓。** `replies` 大於 0 的評論下面有回覆。[Instagram 評論回覆](/zh/apis/instagram/comments/replies/list/)傳這條評論的 `id`，再把帖子短碼作為 `post_id` 傳進去。
4. **排序細看。** 按 `likes` 排一下，點贊最多的那幾條，往往就是大多數人認同的看法。

## 匯出成 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"  # 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"]])
```

上限設 200 頁，碰到幾萬條評論的帖子也不會一直翻下去，花掉計劃外的錢。

## 費用

| 帖子 | 呼叫次數 | 費用 |
|---|---|---|
| 300 條評論，沒有回覆 | 20 | $0.08 |
| 1,000 條評論 | 67 | $0.268 |
| 2,400 條評論，其中 100 條下面有回覆 | 1 + 160 + 100 | $1.044 |

帖子不存在、調用出錯，只要請求到了平台，都照常計費；引數錯誤這類被攔下的不扣費。

## 侷限

- 評論只能從新到舊拿，想按點贊排，下載後自己排。
- 私密帳號拿不到。Instagram 不對外顯示的評論也不會返回，所以拿到的總數可能比帖子上顯示的評論數少。
- 評論者只有使用者名稱，沒有粉絲數。重要的幾個人，用 [Instagram 帳號資訊](/zh/apis/instagram/users/get/)單獨查，每個 $0.004。
- 評論是陌生人寫的。交給模型分析時，要求它只把評論當資料，不要當指令。

## 什麼時候用 Graph API 更合適

如果是你自己的專業帳號，或者客戶的帳號登入授權了你的 App，就用 Graph API 的 comments 介面：按次不收費，還能回覆、隱藏、刪除評論，這些只讀的資料介面都做不了。但要看競品、看想合作的博主、看個人帳號，它就幫不上忙了。評論分析在各平台上的做法，見[口碑研究](/zh/solutions/word-of-mouth/)。

## 用到的介面

- [Instagram 帖子評論](https://okdata.online/zh/apis/instagram/posts/comments/list/) `instagram.posts.comments.list`：$0.004/次 · 每頁約 15 條評論
- [Instagram 評論回覆](https://okdata.online/zh/apis/instagram/comments/replies/list/) `instagram.comments.replies.list`：$0.004/次 · 每頁約 15 條評論
- [Instagram 帖子詳情](https://okdata.online/zh/apis/instagram/posts/get/) `instagram.posts.get`：$0.004/次

## 更多Instagram內容

- [Instagram API](https://okdata.online/zh/apis/instagram/)
- [Instagram API Python 教程：帳號、帖子、評論和 Reels 字幕（2026）](https://okdata.online/zh/guides/instagram-api-python/)
- [有沒有給 Claude 或 Cursor 用的 Instagram MCP 服務，能看主頁、Reels、評論和話題？](https://okdata.online/zh/answers/instagram-mcp-server-claude/)
- [不是自己管理的 Instagram 帳號，怎麼用 API 拿到帖子下的評論？](https://okdata.online/zh/answers/instagram-comments-api-other-accounts/)
- [按千次播放給剪輯手結算，怎麼統計 TikTok、YouTube Shorts、Instagram Reels 和 X 上每條切片的播放量？](https://okdata.online/zh/answers/clipper-payout-view-tracking/)
- [有沒有能讓 Cursor 搜 TikTok、Instagram 和 Reddit 的 MCP？](https://okdata.online/zh/answers/cursor-mcp-tiktok-instagram-reddit/)
- [怎麼用 API 拿到某個 Instagram 話題標籤下的帖子？](https://okdata.online/zh/answers/instagram-hashtag-posts-api/)
- [怎麼找到某個細分領域的 Instagram 博主，並按粉絲數排序？](https://okdata.online/zh/answers/find-instagram-creators-by-niche/)
- [評論介面](https://okdata.online/zh/roles/posts-comments-list/)
- [評論回覆介面](https://okdata.online/zh/roles/comments-replies-list/)
- [內容詳情介面](https://okdata.online/zh/roles/posts-get/)

## 資料來源

這個問題出現過的地方（讀取於 2026-11-15）：

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

更新於 2026-11-15
