# Substack 文章与笔记列表 API (substack.notes)

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

Substack 笔记接口按作者的 `username` 读取这位作者发的 Notes 短动态，每条带类别 `kind`、正文 `text`、点赞数 `like_count` 和发布时间 `posted_at`。它回答「这位作者平时在 Notes 里说什么、转发了哪些文章」，适合跟踪一位作者的日常动态、看他在转发谁的文章，或者把作者的短帖存成语料。

`username` 可以写 @作者，也可以写 substack.com/@作者 的链接。`restacked_post` 只有这条短帖是转发时才出现，里面是原文的标题和链接；`attachment_urls` 只在短帖带附件时出现。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | Substack 作者 handle，可传 @作者 或 substack.com/@作者 链接；返回作者 Notes 短动态，不是专栏长文章。 |
| limit | integer (1–200) | no | 25 | 这次调用最多返回的条数，整数，1–200；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| kind | 条目类别。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_name | 作者昵称（显示名）。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| restacked_post | 这条短帖转发（restack）的原文，含标题和链接；不是转发时不出现这个字段。 |
| attachment_urls | 短帖附带的附件链接；没有附件时不出现这个字段。 |

## 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": "notes",
  "params": {
    "username": "astralcodexten"
  }
}'
```

```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": "notes",
        "params": {
            "username": "astralcodexten",
        },
    },
    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 25. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "substack",
  "action": "notes",
  "results": [
    {
      "id": "p-•••",
      "kind": "restack",
      "author_username": "astralcodexten",
      "author_name": "•••",
      "posted_at": "2026-09-25T22:26:10.306000+00:00",
      "platform": "substack",
      "restacked_post": {
        "title": "Your Book Review: Lee Kuan Yew's Memoirs",
        "url": "https://www.astralcodexten.com/p/your-book-review-lee-kuan-yews-memoirs"
      }
    },
    {
      "id": "p-•••",
      "kind": "restack",
      "author_username": "astralcodexten",
      "author_name": "•••",
      "posted_at": "2026-09-25T06:06:18.720000+00:00",
      "platform": "substack",
      "restacked_post": {
        "title": "Fall Meetups 2026 - Call For Meetup Organizers",
        "url": "https://www.astralcodexten.com/p/fall-meetups-2026-call-for-meetup"
      }
    }
  ],
  "count": 25,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 怎么知道一条短帖转发了哪篇文章？

看 `restacked_post`：这条短帖是转发（restack）时才有这个字段，内容是原文的标题和链接。不是转发时这个字段不会出现，代码里按字段是否存在来判断。

### `username` 能传专栏地址吗？

不能。`username` 是作者的 handle，写 @作者，或者 substack.com/@作者 的链接都行。返回的是作者的 Notes 短动态，不是专栏里的长文章；要读专栏的文章，用出版物文章，传专栏主页链接。

### 它和评论接口怎么分工？

输入不同：评论接口要一篇文章的 /p/ 链接，这里要作者的 `username`。看一篇文章底下读者和作者怎么来回，用评论接口；看一位作者自己平时发什么、转了什么，用这里。两者能接起来：`restacked_post` 里的原文链接如果是一篇 /p/ 文章，可以交给评论接口读它的评论。这里单次最多 200 条。

## 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
