# Substack 单条内容 API (substack.post)

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

Substack 单条内容按一篇文章的 /p/ 链接 `url` 读取这一篇，返回标题、副标题、正文、作者、所属出版物的名称和链接、点赞评论转发数、正文字数 `word_count`、预计阅读时长、内容类型 `post_type`、受众范围 `audience`、是否付费 `is_paid`，播客单集还带音频链接 `podcast_url`。它回答「这篇文章写了什么、反响如何、是不是付费的」，适合内容研究、竞品作者分析，以及把收藏的文章链接批量整理成可检索的资料。

这里只收具体文章链接，专栏主页请交给出版物文章。文章被改过时，可以拿 `updated_at` 和 `posted_at` 对照；`tags` 在没打标签时给空数组。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | 具体 Substack /p/文章链接；返回该单篇文章，不接受专栏主页代替。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| subtitle | 副标题。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_name | 作者昵称（显示名）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| publication_name | 出版物（Newsletter）名称。 |
| publication_handle | 出版物短名。 |
| publication_url | 出版物链接。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| repost_count | 转发数（区别于引用转发）。null 表示不公开。 |
| word_count | 正文字数。 |
| reading_time_minutes | 预计阅读时长，分钟。 |
| post_type | 内容类型（newsletter/podcast/thread 等）。 |
| audience | 受众范围（everyone/paid 等）。 |
| is_paid | 是否为付费内容。 |
| podcast_url | 播客音频链接。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| updated_at | 更新时间。 |
| tags | 标签数组。无标签时为空数组，不是 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": "post",
  "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": "post",
        "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. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "substack",
  "action": "post",
  "results": {
    "id": 210681369,
    "url": "https://www.astralcodexten.com/p/your-book-review-lee-kuan-yews-memoirs",
    "title": "Your Book Review: Lee Kuan Yew's Memoirs",
    "subtitle": "Finalist #10 in the Book Review Contest",
    "text": "Finalist #10 in the Book Review Contest",
    "author_name": "•••",
    "author_username": "•••",
    "publication_name": "Astral Codex Ten",
    "publication_url": "https://www.astralcodexten.com",
    "like_count": 139,
    "comment_count": 31,
    "repost_count": 2,
    "word_count": 5683,
    "post_type": "newsletter",
    "audience": "everyone",
    "is_paid": false,
    "image_url": "https://substack-post-media.s3.amazonaws.com/public/images/3d745943-c11a-4ff0-9c6a-aaf91333ac9f_2546x2560.jpeg",
    "posted_at": "2026-09-25T22:26:10.306000+00:00",
    "updated_at": "2026-09-25T22:30:06.391000+00:00",
    "platform": "substack"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `post_type` 有哪些类型？

常见的有 newsletter（文章）、podcast（播客）和 thread（讨论串）。播客单集会带 `podcast_url` 音频链接，文章类内容主要看 `text`、`word_count` 和 `reading_time_minutes`。取值不止这几种，所以代码里别写成穷举。受众范围看 `audience`，例如 everyone 或 paid；只想知道要不要付费，直接读 `is_paid`。

### 手里是专栏主页链接，能用这一页吗？

不能，这里只读单篇文章，链接里要有 /p/。专栏主页请交给出版物文章，它会列出这个专栏的文章，结果里每篇的 `url` 再传进来就能读单篇。出版物文章默认返回 10 条，单次最多 30 条，还能按内容类型和起止日期筛选；这个接口没有这些筛选，只收一个 `url`。`publication_name` 是文章所属出版物的名称。作者主页通常可以用 `author_username` 拼出来，出版物链接直接读 `publication_url`。

### 怎么判断一篇文章的传播情况？

看 `like_count`、`comment_count` 和 `repost_count`，再对照 `word_count`：在同一个出版物里比较篇幅相近的文章，结果更公平。`like_count` 和 `repost_count` 为 null 表示这个数没有公开，不等于 0；`repost_count` 只算普通转发，引用转发不在里面。对比前先按 `audience` 分组，付费和免费的文章分开比，也可以按 `reading_time_minutes` 把长短文章分开比。

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