# Bilibili Comments API (bilibili.comments)

- Canonical page: https://everyinfra.com/en/bilibili-api/comments
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "bilibili", "action": "comments", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list, default 10, max 10 per call (larger values are capped)
- Mode: sync; add "mode": "async" for slow tasks

Bilibili Comments reads the comment section of one video, given its `url`. Each row carries the comment text, likes, reply count, the commenter's nickname and profile link, the publish time and the video's BV ID. Use it to hear what viewers say: reputation and sentiment analysis, gathering audience feedback or surfacing the most-liked opinions.

Pass the full video link, ideally https://www.bilibili.com/video/<BV ID>. Comments, on-screen comments (danmaku) and subtitles are three different kinds of text: comments are the discussion below the video, on-screen comments are the live remarks that scroll across it, and subtitles are a transcript of the speech, so pick the capability that fits your analysis. Comments with a high `reply_count` are often where the discussion centers.

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | Specifies a full Bilibili video URL, formatted as https://www.bilibili.com/video/<BVID>. The url parameter fetches video comments on comments, first-part timed comments on danmaku, and audio transcription on subtitles, treating each as distinct text sources. The danmaku action must be able to extract a valid BV ID from the provided path. |
| limit | integer (1–10) | no | 10 | The most rows to return in this call, an integer from 1 to 10. The default applies when you leave it out, and a call can return fewer rows. Larger values are accepted and capped at the maximum. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| id | The record's unique ID on the platform. Unique only within one platform; IDs can repeat across platforms. |
| text | Body text with HTML removed, returned in full and never cut short (on a few platforms the list results themselves carry only an excerpt; the platform's field notes say so). |
| like_count | Likes. null means the platform or this capability does not disclose it; it is not 0. |
| reply_count | Replies, usually replies to a comment. null means not disclosed. |
| author_name | Author's display name. |
| author_id | Author's unique ID on the platform. |
| author_url | Link to the author's profile on the platform. |
| posted_at | Publish time in ISO 8601, UTC (for example 2026-08-07T12:34:56+00:00). Non-standard strings from the platform are passed through as is, so parse defensively. null means the platform does not disclose it. |
| video_id | platform-native meaning |
| platform | Source platform identifier, the same as platform in the request (for example 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": "bilibili",
  "action": "comments",
  "params": {
    "url": "https://www.bilibili.com/video/BV1DYjA6KEJ7"
  }
}'
```

```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": "bilibili",
        "action": "comments",
        "params": {
            "url": "https://www.bilibili.com/video/BV1DYjA6KEJ7",
        },
    },
    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": "bilibili",
  "action": "comments",
  "results": [
    {
      "id": "•••",
      "text": "当至冬海关检查我的背包时：",
      "like_count": 8927,
      "reply_count": 173,
      "author_name": "•••",
      "author_id": "•••",
      "author_url": "https://space.bilibili.com/•••",
      "posted_at": "2026-06-18T13:00:49+00:00",
      "video_id": "BV1DYjA6KEJ7",
      "platform": "bilibili"
    },
    {
      "id": "•••",
      "text": "万人血书保护最好的派蒙（1/————）\n（敢动派蒙你就似定了老米）",
      "like_count": 3207,
      "reply_count": 50,
      "author_name": "•••",
      "author_id": "•••",
      "author_url": "https://space.bilibili.com/•••",
      "posted_at": "2026-06-18T13:01:56+00:00",
      "video_id": "BV1DYjA6KEJ7",
      "platform": "bilibili"
    }
  ],
  "count": 20,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## FAQ

### How are comments, on-screen comments and subtitles different?

Comments are the discussion below the video, with likes and replies; on-screen comments, or danmaku, are short live remarks that scroll across playback; subtitles transcribe the speech. All three take the same video link, through the Bilibili Comments, On-screen video comments and Subtitles capabilities.

### In what order do comments come back?

In the order the platform returns them; this capability has no sort parameter. To read by popularity, sort the rows by `like_count` or `reply_count` after you fetch them.

### How do I tie comments back to videos?

Each row carries `video_id`, the BV ID of its video. When you read comments for many videos in one batch, group the rows by it to keep every thread with its own video.

## Also

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