# Medium 用户内容 API (medium.user_posts)

- Canonical page: [https://everyinfra.com/medium-api/user_posts](https://everyinfra.com/medium-api/user_posts?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "medium", "action": "user_posts", "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

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | Medium 作者 handle 或完整作者主页 URL，裸 handle 会组成 https://medium.com/@<handle>；读取该作者的文章列表，不是个人资料详情。 |
| 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": "user_posts",
  "params": {
    "username": "medium"
  }
}'
```

```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": "user_posts",
        "params": {
            "username": "medium",
        },
    },
    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": "user_posts",
  "results": [
    {
      "id": "62edea66ffa4",
      "url": "https://medium.com/blog/updating-our-rules-june-2023-62edea66ffa4",
      "title": "Updating Our Rules — June 2023",
      "text": "Updating Our Rules — June 2023This month, we are updating our Rules. As the world evolves, so do the ways in which people use Medium. To accommodate this, we regularly assess our rules, and adjust them accordingly.We believe that through helping people share their experiences and…",
      "author_name": "Medium",
      "author_url": "",
      "is_members_only": false,
      "posted_at": "2023-06-28T00:00:00+00:00",
      "image_url": "https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62edea66ffa4",
      "platform": "medium",
      "tags": [
        "rules",
        "medium"
      ]
    },
    {
      "id": "cccf29534bf4",
      "url": "https://policy.medium.com/email-import-terms-of-use-cccf29534bf4",
      "title": "Email Import Terms of Use",
      "text": "Effective as of November 8th, 2021By using this feature to import any email addresses (the “Email Import”), you represent and agree that:You have collected all email addresses that you will import through the Email Import in accordance with all applicable local, state, provincial…",
      "author_name": "Medium",
      "author_url": "",
      "is_members_only": false,
      "posted_at": "2021-11-08T00:00:00+00:00",
      "image_url": "https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cccf29534bf4",
      "platform": "medium"
    }
  ],
  "count": 10,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

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