# 豆瓣 评论 API (douban.comments)

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

豆瓣评论接口按条目链接 `url` 读取一个电影、书或音乐条目下的评论，每条带正文 `text`、评分 `rating`、被点「有用」的次数 `vote_count` 和发布时间。它回答「看过的人怎么评价这个条目」，适合做口碑调研，或者挑出被认可的观点。

`url` 要写 movie.douban.com、book.douban.com 或 music.douban.com 的 /subject/<ID>/ 条目链接；`subject_name` 和 `subject_type` 标明评论属于哪个条目。`rating` 的满分看同一行的 `rating_scale`，没有评分的评论就没有 `rating_scale`。

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | reviews / comments 传 movie.douban.com、book.douban.com 或 music.douban.com 的 /subject/<ID>/ 条目链接；group_topic 传 www.douban.com/group/topic/<ID>/。长评、短评和小组回复是不同入口。 |
| limit | integer (1–200) | no | 20 | 这次调用最多返回的条数，整数，1–200；不传按默认值，实际返回可能少于这个数。超过上限会在扣费前返回 422。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | 该记录在原平台上的唯一标识。仅在同一平台内唯一，跨平台可能重复。 |
| subject_id | 条目 ID。豆瓣把书影音统称「条目(subject)」。 |
| subject_name | 条目名称。 |
| subject_type | 条目类型（电影/书/音乐）。 |
| text | 正文内容，已去除 HTML 标签，全文返回、不截断（个别平台的列表结果本身只有摘要，以该平台的字段说明为准）。 |
| rating | 评分。**分制随平台而异**，同一行的 `rating_scale` 给出该平台满分 (多数是 5，Booking/豆瓣/爱奇艺/NAVER 是 10)。跨平台比较前必须先按 rating_scale 换算。直接比数字会得出反的结论。 |
| rating_scale | 上一列 `rating` 的满分。5 表示五星制、10 表示十分制。只在该行有 rating 时出现。 |
| rating_label | 评分档位文字。 |
| author_name | 作者昵称（显示名）。 |
| author_url | 作者在原平台的主页链接。 |
| author_avatar_url | 评论者头像。 |
| vote_count | 这条评论被点「有用」的次数（comments）。 |
| posted_at | 发布时间，ISO 8601 格式、UTC 时区（如 2026-08-07T12:34:56+00:00）。平台只给非标准字符串时原样透传，解析前建议做容错。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": "douban",
  "action": "comments",
  "params": {
    "url": "https://book.douban.com/subject/2567698/"
  }
}'
```

```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": "douban",
        "action": "comments",
        "params": {
            "url": "https://book.douban.com/subject/2567698/",
        },
    },
    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 20. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "id": "req_…",
  "platform": "douban",
  "action": "comments",
  "results": [
    {
      "id": "•••",
      "subject_id": "2567698",
      "subject_name": "三体",
      "subject_type": "book",
      "text": "一直认为写作是件很耗费体力与脑力的事情，特别是从新构架一个新的世界，一个文明。这需要你有丰富的尝试与思考，过去，我们从来不缺少天马行空的想象力，但是少有一个如刘慈欣般有着历史、物理学与哲学思考的作者。所以从这个角度来讲，三体的出现对中国科幻界绝对是幸事。霍金之前曾经警告过我们，如果有外星人，他们对地球也是恶意的。那时我不懂，在读完这本书时我回想自己小时候拍打小虫子时的情景。或许，在更高级别的文明里，你我只不过是虫子。",
      "rating": 5,
      "rating_label": "力荐",
      "author_name": "•••",
      "author_url": "https://www.douban.com/•••",
      "author_avatar_url": "https://img9.doubanio.com/•••",
      "vote_count": 13037,
      "posted_at": "2011-08-14T06:27:05+00:00",
      "platform": "douban",
      "rating_scale": 10
    },
    {
      "id": "•••",
      "subject_id": "2567698",
      "subject_name": "三体",
      "subject_type": "book",
      "text": "有点屌，也有点“作者语文是物理老师教的”的感觉",
      "rating": 5,
      "rating_label": "力荐",
      "author_name": "•••",
      "author_url": "https://www.douban.com/•••",
      "author_avatar_url": "https://img3.doubanio.com/•••",
      "vote_count": 9166,
      "posted_at": "2014-09-11T03:50:16+00:00",
      "platform": "douban",
      "rating_scale": 10
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### `vote_count` 有什么用？

它是这条评论被点「有用」的次数，评价接口没有这个字段。想先看读者最认可的评论，按 `vote_count` 从高到低排，再看 `rating` 和 `text`。评价接口则带标题、链接和回复数，但没有这个计数。

### 不同评论的 `rating` 能直接比较吗？

`rating_scale` 相同的两条可以直接比；字段说明里豆瓣的满分是 10。要和别的平台的评分放在一起看，先按各自的 `rating_scale` 换算，拿原始数字硬比会得出相反的结论。`rating_label` 是评分档位的文字，可以和数字对照着读。

### 小组帖子的回复能用这个接口读吗？

不能。`url` 传的是条目链接，也就是 /subject/<ID>/ 这种；小组帖子的链接是 www.douban.com/group/topic/<ID>/，走另一个入口。长评、短评和小组回复是不同的入口，链接和接口要对上。

## Also

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