# Instagram 评论 API (instagram.comments)

- Canonical page: https://everyinfra.com/instagram-api/comments
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "instagram", "action": "comments", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 50, max 100 per call
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=instagram&action=comments

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | comments 的单个 Instagram 帖子或 Reel 链接；不是账号主页。 |
| limit | integer (1–100) | no | 50 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| url | 该记录在原平台上的可访问链接。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| reply_count | 回复数，通常用于评论的子回复。null 表示不公开。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| is_verified | 是否为平台认证账号（蓝V等）。null 表示无法判定。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| post_url | 帖子链接。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "instagram",
  "action": "comments",
  "params": {
    "url": "https://www.instagram.com/p/DbYmqpplO_N/"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "instagram",
        "action": "comments",
        "params": {
            "url": "https://www.instagram.com/p/DbYmqpplO_N/",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-09-26T08:56:04Z. `results` and `count` are real with personal information (names, handles, avatars, profile links, contact details) removed; the list keeps the first 2 of 15. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "instagram",
  "action": "comments",
  "results": [
    {
      "id": "•••",
      "text": "https://app.emergent.sh/chat\nSo I developed an app that is called Earth's Cosmos 2 Cosmos watch and there is a small subscription to it is five dollars a month and you can cancel at any time I liked it for you to be my first subscriber it's based on research and information that …",
      "url": "https://www.instagram.com/p/DbYmqpplO_N/c/17931449676404522",
      "like_count": 0,
      "author_username": "•••",
      "is_verified": false,
      "posted_at": "2026-09-20T21:43:10+00:00",
      "post_url": "https://www.instagram.com/p/DbYmqpplO_N/",
      "platform": "instagram"
    },
    {
      "id": "•••",
      "text": "🙏⚽",
      "url": "https://www.instagram.com/p/DbYmqpplO_N/c/17874993174565429",
      "like_count": 0,
      "author_username": "•••",
      "is_verified": false,
      "posted_at": "2026-09-16T01:41:58+00:00",
      "post_url": "https://www.instagram.com/p/DbYmqpplO_N/",
      "platform": "instagram"
    }
  ],
  "count": 15,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=instagram
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
