# Substack 出版物或专栏 API (substack.publication)

- Canonical page: [https://everyinfra.com/substack-api/publication](https://everyinfra.com/substack-api/publication?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "substack", "action": "publication", "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 出版物接口按专栏主页 `url` 读取一个专栏的资料：名称 `name`、短名 `handle`、简介 `bio`、封面、头像、作者，以及订阅数 `subscriber_count` 和是否开通付费 `payments_enabled`。它回答「这个专栏是谁在写、有没有开付费、订阅规模多大」，适合评估合作对象，或者给竞品 Newsletter 建档。

`url` 要能从 *.substack.com 地址里取出专栏 handle，自定义域名不保证被识别。`custom_domain` 有值，可以作为作者有意长期经营的参考。`bio` 是账号自己填的文本，可能含换行和 emoji；`language` 的语言代码由平台判定，不一定准。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | Substack 专栏主页 URL；需要能从 *.substack.com 地址提取专栏 handle，自定义域名不能保证被识别。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| handle | 用户短名。 |
| name | 名称。用于账号/商品/商家类能力，指该对象本身的名字。 |
| url | 该记录在原平台上的可访问链接。 |
| custom_domain | 自定义域名，配了说明作者有意长期经营。 |
| bio | 个人简介，账号自己填写的文本。可能含换行和 emoji。 |
| language | 内容语言代码（如 zh、en），由平台判定，可能不准。 |
| subscriber_count | 订阅数。Substack 只对部分账号公开，null 不等于 0。 |
| payments_enabled | 该出版物是否开通了付费订阅。 |
| avatar_url | 头像图片链接。部分平台给的是带尺寸参数的 CDN 链接，可能有时效。 |
| cover_url | 封面图。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| author_name | 作者昵称（显示名）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| top_posts | platform-native meaning |

## 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": "publication",
  "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": "publication",
        "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": "publication",
  "results": {
    "handle": "•••",
    "name": "Astral Codex Ten | Scott Alexander",
    "url": "https://astralcodexten.substack.com",
    "custom_domain": "astralcodexten.com",
    "bio": "P(A|B) = [P(A)*P(B|A)]/P(B), all the rest is commentary. Click to read Astral Codex Ten, by Scott Alexander, a Substack publication.",
    "language": "en",
    "payments_enabled": true,
    "avatar_url": "https://substackcdn.com/•••",
    "platform": "substack"
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### 专栏用了自己的域名，`url` 还能直接传吗？

不一定。`url` 需要能从 *.substack.com 地址里提取出专栏 handle，自定义域名不能保证被识别。如果只是想列出这个专栏的文章，出版物文章那一页明确支持完整的自定义域名地址，可以直接用它。

### `subscriber_count` 是 null 说明没人订阅吗？

不是。Substack 只对部分账号公开订阅数，null 表示没有公开，不等于 0。比较多个专栏时，只比有数的，null 的另列一栏。`payments_enabled` 能补一点信息，它只说明这个出版物有没有开通付费订阅，说明不了订阅规模。

### 关键词搜索和这个接口怎么分工？

关键词搜索按关键词一次返回多个专栏，默认 10 条、最多 30 条；这个接口按 `url` 返回一个专栏。先搜索圈出候选，再用这个接口逐个读详情。两边的返回字段一样，差别只在输入：搜索接受关键词，这个接口要专栏主页链接。

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