# Medium 出版物或专栏 API (medium.publication)

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

Medium 出版物按 `publication` 读取一个刊物或专栏下的文章列表，每条带标题、正文 `text`、作者昵称和用户名、所属专栏名 `publication_name`、点赞评论数、预计阅读时长 `reading_time_minutes`、是否会员专享 `is_members_only` 和发布时间。追踪一个行业刊物的选题方向，或监测竞品刊物发了什么，读这个接口。

`publication` 填刊物短名或完整刊物链接，不是文章标题，也不是作者的用户名；只填短名时会补成 medium.com/<刊物>。默认返回 10 条，单次最多 25 条。可选的 `url` 只是完整刊物或作者链接的兼容输入，用了它，`publication` 仍然要填。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| publication | not declared | yes | not declared | Medium 刊物短名或完整刊物 URL；不是一篇文章标题或作者 handle，裸短名会组成 medium.com/<刊物>。 |
| url | not declared | no | not declared | user_posts/publication 的完整作者或刊物 URL 兼容输入；各接口必填 username/publication 仍需提供。列表可能包含受限文章，不代表可获得付费全文。 |
| limit | integer (1–25) | no | 10 | 这次调用最多返回的条数，整数，1–25；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| url | 该记录在原平台上的可访问链接。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| author_name | 作者昵称（显示名）。 |
| author_username | 作者用户名（@handle），通常可用于拼 URL。 |
| author_url | 作者在原平台的主页链接。 |
| publication_name | 所属专栏名称。Medium 的文章可发在个人或专栏下。 |
| like_count | 点赞数。null 表示该平台或该接口不公开此数据，不等于 0。 |
| comment_count | 评论数。null 表示不公开，不等于 0。 |
| reading_time_minutes | 预计阅读时长，分钟。 |
| is_members_only | 是否为会员专享文章。非会员只能看开头。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。null 表示平台未公开。 |
| image_url | 图片链接。多图能力可能返回 image_urls 数组。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |
| tags | 标签数组。无标签时为空数组，不是 null。 |

## 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": "medium",
  "action": "publication",
  "params": {
    "publication": "better-programming"
  }
}'
```

```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": "medium",
        "action": "publication",
        "params": {
            "publication": "better-programming",
        },
    },
    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 10. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "medium",
  "action": "publication",
  "results": [
    {
      "id": "bf37baef8f27",
      "url": "https://medium.com/better-programming/let-a-thousand-programming-publications-bloom-bf37baef8f27",
      "title": "Let a thousand programming publications bloom.",
      "text": "I’m putting Better Programming on hiatus to make room for other programming publications.I get that this is a big pivot given that we switched to a new editor recently. But things are changing at Medium and I think this will ultimately be a boon for everyone, authors, readers and…",
      "author_name": "•••",
      "author_url": "",
      "is_members_only": false,
      "posted_at": "2023-11-10T00:00:00+00:00",
      "image_url": "https://cdn-images-1.medium.com/max/1024/1*tKikPWjE4MZ5WgdfZuyvEg.png",
      "platform": "medium"
    },
    {
      "id": "3f456a51ff99",
      "url": "https://medium.com/better-programming/calling-aws-bedrock-from-code-3f456a51ff99",
      "title": "Calling AWS Bedrock from code",
      "text": "Using Python in a Jupyter notebook",
      "author_name": "•••",
      "author_url": "",
      "is_members_only": false,
      "posted_at": "2023-11-10T00:00:00+00:00",
      "image_url": "https://cdn-images-1.medium.com/max/600/1*iltZoO6rmWj_AnfNpJ1m-A.png",
      "platform": "medium",
      "tags": [
        "bedrock",
        "python",
        "llm"
      ]
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `publication` 能填文章标题或作者用户名吗？

不能。要填刊物的短名或完整刊物链接，例如 better-programming；只给短名时，会补成 medium.com/<刊物>。

### 拿到列表就能读付费文章全文吗？

不能保证。列表可能包含受限文章，出现在列表里不代表能拿到付费全文。`is_members_only` 为真的是会员专享文章，非会员只能看开头，统计内容时先用它把这类文章分开。

### 出版物和标签内容该用哪个？

要跟一个固定刊物的更新，用出版物，传刊物短名；要跨作者看一个话题，用标签内容，传话题标签。两个接口返回的字段相同，区别只在入口。

## Also

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