# Substack 评论 API (substack.comments)

- Canonical page: [https://everyinfra.com/substack-api/comments](https://everyinfra.com/substack-api/comments?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "substack", "action": "comments", "params": {...}}
- Price: $0.001389 per call ($1.39 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 20, max 100 per call
- Mode: sync; add "mode": "async" for slow tasks

Substack 评论接口按文章的 /p/ 链接 `url` 读取这篇文章的评论树，每条带正文 `text`、作者昵称和用户名、点赞数、发布时间，以及回复数 `reply_count`。它回答「读者对这篇文章怎么说、作者有没有下场回应」，适合收集读者反馈、找出讨论最热的话题，或者看某位作者怎么和读者互动。

`reply_to_id` 指向被回复内容的 ID，配合 `is_reply` 能把回复挂回上一级；`is_pinned` 标出置顶评论，`is_author` 标出评论者是不是文章作者本人。它按文章取评论，不能按专栏搜评论。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 具体 Substack /p/文章链接；返回该文章的评论树，不是专栏级评论搜索。 |
| limit | integer (1–100) | no | 20 | 这次调用最多返回的条数，整数，1–100；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_name | 作者昵称（显示名）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| reply_count | 回复数，通常用于评论的子回复。null 表示不公开。 |
| reply_to_id | 被回复内容的 ID。 |
| is_reply | 是否为回复（Notes 场景）。 |
| is_pinned | 是否置顶。 |
| is_author | 评论者是否为文章作者本人。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| 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": "substack",
  "action": "comments",
  "params": {
    "url": "https://astralcodexten.substack.com"
  }
}'
```

```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": "substack",
        "action": "comments",
        "params": {
            "url": "https://astralcodexten.substack.com",
        },
    },
    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 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "substack",
  "action": "comments",
  "results": [
    {
      "id": 345951947,
      "text": "He's got my vote.",
      "author_name": "•••",
      "author_username": "•••",
      "like_count": 2,
      "is_reply": false,
      "is_pinned": false,
      "is_author": false,
      "posted_at": "2026-09-25T22:42:35.602000+00:00",
      "platform": "substack"
    },
    {
      "id": 345953405,
      "text": "For Terry Pratchett fans out there, every time I read about a Lord Vetinari decision I was reminded of Lee Kuan Yew. The former is perhaps a little more ruthless (ahem, why waste all that training?), but rational; more importantly, competent. Lee also built institutions that last…",
      "author_name": "•••",
      "author_username": "•••",
      "like_count": 1,
      "is_reply": false,
      "is_pinned": false,
      "is_author": false,
      "posted_at": "2026-09-25T22:45:21.896000+00:00",
      "platform": "substack"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 怎么区分作者本人的回复和读者的评论？

看 `is_author`：为真表示评论者就是文章作者本人。要把作者的回复放回它所回应的评论下面，用 `reply_to_id` 找到被回复内容的 ID。`reply_count` 是一条评论下的回复数，null 表示不公开。

### 能一次读整个专栏的评论吗？

不能。`url` 要传具体文章的 /p/ 链接，返回的是这篇文章的评论树，不是专栏级的评论搜索。想覆盖一个专栏，先用出版物文章列出文章，再逐篇传入各自的 `url`。

### 它和文章与笔记列表是一回事吗？

不是。评论接口按文章链接读文章底下的评论，默认 20 条、最多 100 条；文章与笔记列表按作者用户名读作者发的 Notes 短动态，默认 25 条、最多 200 条。评论这边有置顶、作者本人、回复数和被回复 ID，Notes 那边没有；Notes 有条目类别、转发的原文和附件链接，评论这边没有。

## Also

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