Bilibili comments API

Based on the 2026-11-21 specification

Quick answer

POST /bilibili/pushs/task with a /video/BV... URL starts an asynchronous task that collects the comments of that video; crawl_second_layer (default true) adds the replies under each comment. Poll GET /bilibili/pushs/task/{task_id}; once DONE it returns task, total_count and data, up to 1000 comments per page, newest first. Each comment has post_id (the video's document ID), push_type (comment or reply), the commenter, text, time and a sentiment label. Coverage is limited: a task collects at most the video's 3 most popular top-level comments and the first 20 replies under each. Data is collected by web crawlers from content publicly published on Bilibili.

What teams use it for

  • Read the most visible reactions under a product review or brand video.
  • Compare the sentiment of the top comments across several videos on the same topic.
  • Combine with keyword search to follow the discussion under the videos that matter.

Endpoints

Base URL: https://api.infominer.io/api/v2. Send your API key in the auth-header request header.

MethodPathWhat it does
POST /bilibili/pushs/task Create a comment task from a /video/BV... URL, optionally with replies.
GET /bilibili/pushs/task/{task_id} Poll the comment task; once DONE it returns the comments, up to 1000 per page.

Request parameters

POST /bilibili/pushs/task

ParameterInTypeRequiredDefault / allowedDescription
post_url body string Yes Bilibili video URL, https://www.bilibili.com/video/BV.../ (tracking parameters allowed). av URLs and b23.tv short links are not accepted.
crawl_second_layer body boolean No true Also collect the replies under each comment.
max_pages body integer No 50 (max 200) Maximum pages of top-level comments; 0 or omitted uses the default.
rerun body boolean No Accepted for consistency with other platforms; every POST creates a new task.

GET /bilibili/pushs/task/{task_id}

ParameterInTypeRequiredDefault / allowedDescription
task_id path string Yes Task ID returned when the task was created.
page query integer No 1 Page number, starting at 1.
pageSize query integer No 1000 Comments per page, max 1000.

Response fields

DataFieldsEndpoint
Comments and replies (data) id, post_id, author_id, author, push_type, region, content, tm, tm_crawler, sentiment GET /bilibili/pushs/task/{task_id}
Task (task) task: id, post_url, status, crawl_second_layer, created_at, total, completed, pages_crawled, reported_total, partial, timed_out, failed_pages, failed_batches, bvid GET /bilibili/pushs/task/{task_id}

Code examples

curl: create the task

curl -X POST https://api.infominer.io/api/v2/bilibili/pushs/task \
  -H "auth-header: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"post_url": "https://www.bilibili.com/video/BV1000000001/", "crawl_second_layer": true}'

curl: poll the task by ID

curl "https://api.infominer.io/api/v2/bilibili/pushs/task/$TASK_ID?page=1&pageSize=1000" \
  -H "auth-header: YOUR_API_KEY"

Python (requests): create, poll, read

import time
import requests

BASE_URL = "https://api.infominer.io/api/v2"
HEADERS = {"auth-header": "YOUR_API_KEY"}

# 1. Create the task
resp = requests.post(
    f"{BASE_URL}/bilibili/pushs/task",
    headers=HEADERS,
    json={
        "post_url": "https://www.bilibili.com/video/BV1000000001/",
        "crawl_second_layer": True,
    },
    timeout=30,
)
resp.raise_for_status()
task = resp.json()

# 2. Poll until the task leaves INIT / RUNNING
for _ in range(120):
    resp = requests.get(
        f"{BASE_URL}/bilibili/pushs/task/{task['id']}",
        headers=HEADERS,
        params={
            "page": 1,
            "pageSize": 1000,
        },
        timeout=30,
    )
    resp.raise_for_status()
    result = resp.json()
    status = result.get("status") or result.get("task", {}).get("status")
    if status not in ("INIT", "RUNNING"):
        break
    time.sleep(15)
else:
    raise SystemExit("task still running; poll it again later")

task = result.get("task", result)
if status != "DONE" or task.get("partial") or task.get("timed_out"):
    raise SystemExit(f"task ended with status {status}; no complete result")

# 3. Read the records (use page / pageSize to fetch further pages)
for row in result.get("data", []):
    print(row.get("push_type"), row.get("author"), (row.get("content") or "")[:60])

Sample response

Illustrative data written by hand: accounts are sample_user_n and IDs are obviously fake. Fields follow the 2026-11-21 specification; the sample shows a subset of the fields.

Poll response once the task is DONE (illustrative data)

{
  "task": {
    "id": "00000000-0000-4000-8000-000000000001",
    "post_url": "https://www.bilibili.com/video/BV1000000001/",
    "status": "DONE",
    "crawl_second_layer": true,
    "created_at": 1780880400,
    "total": 3,
    "completed": 3,
    "pages_crawled": 1,
    "reported_total": 46,
    "timed_out": false,
    "partial": false,
    "failed_pages": 0,
    "failed_batches": 0,
    "bvid": "BV1000000001"
  },
  "total_count": 3,
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000003",
      "post_id": "00000000-0000-4000-8000-000000000001",
      "author_id": "0000000003",
      "author": "sample_user_3",
      "tm": 1780745400,
      "tm_crawler": 1780880403,
      "push_type": "comment",
      "region": "",
      "content": "清单很实用,第一次去营地就照着准备了",
      "sentiment": "Positive"
    },
    {
      "id": "00000000-0000-4000-8000-000000000004",
      "post_id": "00000000-0000-4000-8000-000000000001",
      "author_id": "0000000004",
      "author": "sample_user_4",
      "tm": 1780743600,
      "tm_crawler": 1780880406,
      "push_type": "reply",
      "region": "",
      "content": "请问睡袋选的是几度的?",
      "sentiment": "Neutral"
    },
    {
      "id": "00000000-0000-4000-8000-000000000005",
      "post_id": "00000000-0000-4000-8000-000000000001",
      "author_id": "0000000005",
      "author": "sample_user_5",
      "tm": 1780741800,
      "tm_crawler": 1780880409,
      "push_type": "comment",
      "region": "",
      "content": "防潮垫那段讲得很清楚",
      "sentiment": "Positive"
    }
  ],
  "page": 1,
  "pageSize": 1000
}

Limits and notes

  • A task collects at most the video's 3 most popular top-level comments and the first 20 replies under each, so completed far below reported_total (the count Bilibili shows) is expected.
  • region (IP location) is always empty for Bilibili comments.
  • av URLs and b23.tv short links are not accepted; expand them to a /video/BV... URL first.
  • Only a DONE poll carries data; PARTIAL, TIMED_OUT and FAILED return the task object alone. Treat a task as fully successful when status is DONE and partial and timed_out are both false.
  • data holds every collected comment of the video, including earlier tasks' comments, so total_count can differ from task.completed. Counts are as of collection.
Collection: web crawlers collect content publicly published on each platform. Whether this suits your use depends on the purpose and jurisdiction and is for the buyer's legal team to assess; we can provide a description of sources and collection methods.

More Bilibili API pages

Request a trial

In the form below, mention Bilibili and tell us the keywords or videos you want to follow, whether you need comments, and the expected volume. We will confirm the scope and arrange a trial and an API key.

Fill in the form to request a trial. We confirm the scope and reply with trial and integration arrangements.

Fill in the request form

FAQ

Can I collect all comments of a Bilibili video?
No. A task collects at most the 3 most popular top-level comments and the first 20 replies under each. Compare task.completed with reported_total to see the share collected.
When does a Bilibili comment task fail?
It ends FAILED when the video does not exist, was deleted, is not public or is under review, when its comment section is closed, or when Bilibili refuses the first page.
How do comments link to the video?
Every comment has post_id, the document ID of the video, which equals the id of the same video in search results. The task object also carries the video's bvid.
How is the data collected? Is this the official Bilibili API?
By web crawlers, from content publicly published on Bilibili. LargitData is not affiliated with Bilibili and this is not Bilibili's own API. Whether this suits your use depends on the purpose and jurisdiction and is for your legal team to assess; we can provide a description of sources and collection methods.