# Medium 标签内容 API (medium.tag)

- Canonical page: [https://everyinfra.com/medium-api/tag](https://everyinfra.com/medium-api/tag?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "medium", "action": "tag", "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 标签内容按 `tag` 读取一个话题标签下的文章列表，每条带标题、正文 `text`、作者昵称和用户名、所属专栏名、点赞评论数、预计阅读时长、是否会员专享和发布时间。做选题调研、看一个技术话题下有哪些作者在写，可以从这里开始。

`tag` 是话题标签的短名，例如 machine-learning。写成带开头 #、大小写混合或带空格的形式也行，接口会去掉 #、转成小写，再把空白换成连字符。它不是任意全文搜索，想搜任意词不能用它。单次最多 25 条，默认 10 条。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| tag | not declared | yes | not declared | Medium 话题标签短名，例如 machine-learning；会去掉开头 #、转小写，并把空白变为连字符。不是任意全文搜索查询。 |
| 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": "tag",
  "params": {
    "tag": "software-engineering"
  }
}'
```

```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": "tag",
        "params": {
            "tag": "software-engineering",
        },
    },
    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": "tag",
  "results": [
    {
      "id": "c042f2934685",
      "url": "https://chinmaybhatk.medium.com/the-weekend-app-and-the-month-6-bill-c042f2934685",
      "title": "The weekend app and the month-6 bill",
      "text": "What a 2-day AI build leaves out of a business system, and where AI does its best work on one.",
      "author_name": "•••",
      "author_url": "",
      "is_members_only": false,
      "posted_at": "2026-09-26T00:00:00+00:00",
      "platform": "medium",
      "tags": [
        "erp-software",
        "software-engineering",
        "enterprise-software"
      ]
    },
    {
      "id": "cf842dd0cb8f",
      "url": "https://satyamsinghhelping.medium.com/how-billions-of-events-move-through-systems-like-uber-and-google-cf842dd0cb8f",
      "title": "How Billions of Events Move Through Systems Like Uber and Google",
      "text": "Imagine Uber receives millions of events every minute.",
      "author_name": "•••",
      "author_url": "",
      "is_members_only": false,
      "posted_at": "2026-09-26T00:00:00+00:00",
      "image_url": "https://cdn-images-1.medium.com/max/1672/1*JA6cmZN-CGVcnkfZZOjrjg.png",
      "platform": "medium",
      "tags": [
        "software-engineering",
        "big-data",
        "apache-kafka"
      ]
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `tag` 填 Machine Learning 可以吗？

可以。会去掉开头的 #，转成小写，并把空白换成连字符，所以 Machine Learning 会变成 machine-learning。参数示例填的是 software-engineering，直接写成这种短名最稳。

### `tag` 可以当关键词搜索用吗？

不可以。它是话题路径短名，不是任意全文搜索查询，也不是文章链接或作者用户名。要查一个刊物下的文章，换用出版物接口，传刊物短名。

### 结果里怎么区分个人文章和专栏文章？

看 `publication_name`：Medium 的文章可以发在个人名下，也可以发在专栏下，这个字段是所属专栏名称。作者信息在 `author_name`、`author_username` 和 `author_url`，其中 `author_username` 通常可用于拼 URL。

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