# How to get Bilibili video comments by BV ID

Pass the BV ID and page with `data.next`, which counts the page number up. Ten pages are about 180 comments for 10 calls and $0.02, without wbi signing or a 412 block.

Updated 2026-11-22

## Page through the comments

`bv_id` is the `BV...` part of a bilibili.com/video link. Paging is by page number: `data.next` is `{"pn": 2}`, then 3, and so on, until it is null.

[Bilibili comments API](https://xtikapi.com/apis/bilibili/comments/list): `GET /v1/bilibili/comments/list`, $0.002 a call

```bash
curl "https://xtikapi.com/v1/bilibili/comments/list?bv_id=BV1zGy5ziEnd" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```python
import requests

URL = "https://xtikapi.com/v1/bilibili/comments/list"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

params = {"bv_id": "BV1zGy5ziEnd"}
items = []
for _ in range(10):  # one call per page
    for attempt in range(3):  # 5xx errors are not charged: retry
        response = requests.get(URL, params=params, headers=HEADERS, timeout=60)
        if response.status_code < 500:
            break
    response.raise_for_status()
    data = response.json()["data"]
    items += data["items"]
    if not data.get("next"):  # null on the last page
        break
    params.update(data["next"])

print(len(items), "items")
```

```javascript
const URL = "https://xtikapi.com/v1/bilibili/comments/list";
const HEADERS = { Authorization: "Bearer YOUR_API_KEY" };

let params = {"bv_id":"BV1zGy5ziEnd"};
const items = [];
for (let page = 0; page < 10; page++) {
  let response;
  for (let attempt = 0; attempt < 3; attempt++) {
    // 5xx errors are not charged: retry
    response = await fetch(`${URL}?${new URLSearchParams(params)}`, { headers: HEADERS });
    if (response.status < 500) break;
  }
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const { data } = await response.json();
  items.push(...data.items);
  if (!data.next) break; // null on the last page
  params = { ...params, ...data.next };
}
console.log(items.length, "items");
```

Recorded response (lists keep the first two items):

```json
{
  "data": {
    "items": [
      {
        "id": "627037004863",
        "text": "Example text",
        "author": {
          "id": "691389870",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "description": "Example text"
        },
        "createdAt": "2026-11-18T18:21:51.000Z",
        "likeCount": 72,
        "replyCount": 7
      },
      {
        "id": "627020641159",
        "text": "Example text",
        "author": {
          "id": "6467168760735863",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg"
        },
        "createdAt": "2026-11-18T14:20:14.000Z",
        "likeCount": 21,
        "replyCount": 13
      }
    ],
    "has_more": true,
    "next": {
      "pn": 2
    }
  },
  "meta": {
    "request_id": "example",
    "endpoint": "bilibili.comments.list",
    "normalized": true,
    "unavailable": [],
    "billing": {
      "charged": true,
      "amount": 0.002,
      "balance": 4.98
    }
  }
}
```

## What the example costs

| Step | Calls | Price | Subtotal |
| --- | --- | --- | --- |
| Comments, 10 pages | 10 | $0.002 | $0.02 |
| Total | 10 | | $0.02 |

## Good to know

- In our tests on 2026-11-22 the first page held 3 or 20 comments and later pages 20; ten pages gave 183 comments.
- Bilibili sometimes answers a page empty although more comments exist. The gateway retries it, and if it still fails you get a retryable error that is not charged; the code above retries it once more.
- Stop on `data.next` being null, not on a short page.
- Replies come from `bilibili.comment_replies.list`. Danmaku (bullet comments) are not returned.

## Endpoints

- [Bilibili comments API](https://xtikapi.com/apis/bilibili/comments/list): $0.002 a call

## Questions

### How much does this cost with XTikAPI?

The example here is 10 calls, $0.02 in total. Failed calls and timeouts are free, and a new account with a verified email gets $0.50 of trial balance.

### Can I pass an av number?

This call takes the BV ID. Old av links redirect to a BV link on bilibili.com; use the BV part of that link.

---

XTikAPI: one API key for public social media data, prepaid per call. [HTML version](https://xtikapi.com/guides/bilibili-video-comments) · [llms.txt](https://xtikapi.com/llms.txt) · [OpenAPI](https://xtikapi.com/openapi.json)
