Bilibili video keyword search API

Based on the 2026-11-21 specification

Quick answer

POST /bilibili/search/task searches Bilibili videos by keyword and publish date range (YYYY-MM-DD, UTC+8, inclusive; default the last 7 days), newest first. max_pages runs from 0 to 50 (0 or omitted means 50) at 20 videos per page, so one query reaches about 1,000 videos. Poll GET /bilibili/search/task/{task_id}; once DONE the response carries task, total_count and data, up to 100 videos per page. Each video has its URL, title, description, uploader name and ID, publish time, view, like and comment counts, a sentiment label and the cover image. Data is collected by web crawlers from content publicly published on Bilibili.

What teams use it for

  • Track how a product, brand or topic is covered in Bilibili videos, and rank the videos by views or likes.
  • Build a dated list of videos on a topic for market or academic research.
  • Pass the video URLs to the Bilibili comments API to see how viewers responded.

Endpoints

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

MethodPathWhat it does
POST /bilibili/search/task Create a video keyword search task with an optional date range and page limit.
GET /bilibili/search/task/{task_id} Poll the search task; once DONE it returns the videos and total_count, up to 100 per page.

Request parameters

POST /bilibili/search/task

ParameterInTypeRequiredDefault / allowedDescription
keyword body string Yes Search keyword, 1 to 100 characters.
end_date body string No End date, inclusive (YYYY-MM-DD, UTC+8). Defaults to today.
max_pages body integer No 50 (max 50) Maximum result pages; 0 or omitted uses the default. 20 videos per page.
rerun body boolean No Accepted for consistency with other platforms; every POST creates a new task.
start_date body string No Start date, inclusive (YYYY-MM-DD, UTC+8). Defaults to 7 days ago.

GET /bilibili/search/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 100 Videos per page, max 100.

Response fields

DataFieldsEndpoint
Videos (data) id, url, title, content, tm, datetime, tm_crawler, tm_update, author, author_id, type, ctype, source, sentiment, view_count, like_count, comment_count, metadata_img GET /bilibili/search/task/{task_id}
Search task (task) task: id, keyword, status, start_date, end_date, max_pages, created_at, total, completed, pages_crawled, partial, timed_out, failed_pages, failed_articles, failed_ranges, num_results GET /bilibili/search/task/{task_id}

Code examples

curl: create the task

curl -X POST https://api.infominer.io/api/v2/bilibili/search/task \
  -H "auth-header: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"keyword": "露营装备", "start_date": "2026-06-01", "end_date": "2026-06-07", "max_pages": 3}'

curl: poll the task by ID

curl "https://api.infominer.io/api/v2/bilibili/search/task/$TASK_ID?page=1&pageSize=100" \
  -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/search/task",
    headers=HEADERS,
    json={
        "keyword": "露营装备",
        "start_date": "2026-06-01",
        "end_date": "2026-06-07",
        "max_pages": 3,
    },
    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/search/task/{task['id']}",
        headers=HEADERS,
        params={
            "page": 1,
            "pageSize": 100,
        },
        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("url"), (row.get("title") 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",
    "keyword": "露营装备",
    "status": "DONE",
    "start_date": "2026-06-01",
    "end_date": "2026-06-07",
    "max_pages": 3,
    "created_at": 1780880400,
    "total": 2,
    "completed": 2,
    "pages_crawled": 1,
    "num_results": 2,
    "timed_out": false,
    "partial": false,
    "failed_pages": 0,
    "failed_articles": 0,
    "failed_ranges": 0
  },
  "total_count": 2,
  "data": [
    {
      "id": "00000000-0000-4000-8000-000000000001",
      "url": "https://www.bilibili.com/video/BV1000000001/",
      "title": "新手露营装备清单,第一次出门带这些就够了",
      "content": "新手露营装备清单,第一次出门带这些就够了",
      "tm": 1780666200,
      "datetime": "2026-06-05 21:30:00",
      "tm_crawler": 1780880405,
      "tm_update": 1780880405,
      "author": "sample_user_1",
      "author_id": "0000000001",
      "type": [
        "sample_user_1"
      ],
      "ctype": [
        "sample_user_1"
      ],
      "source": "bilibili",
      "sentiment": "Positive",
      "view_count": 5230,
      "like_count": 318,
      "comment_count": 46,
      "metadata_img": [
        "https://i0.hdslb.com/bfs/archive/sample_cover_1.jpg"
      ]
    },
    {
      "id": "00000000-0000-4000-8000-000000000002",
      "url": "https://www.bilibili.com/video/BV1000000002/",
      "title": "三款轻量帐篷实测:下雨天的表现差别很大",
      "content": "露营装备里最难选的是帐篷,同一个周末在山上搭了三款,记录了防水和通风的情况",
      "tm": 1780452000,
      "datetime": "2026-06-03 10:00:00",
      "tm_crawler": 1780880409,
      "tm_update": 1780880409,
      "author": "sample_user_2",
      "author_id": "0000000002",
      "type": [
        "sample_user_2"
      ],
      "ctype": [
        "sample_user_2"
      ],
      "source": "bilibili",
      "sentiment": "Neutral",
      "view_count": 1870,
      "like_count": 95,
      "comment_count": 21,
      "metadata_img": [
        "https://i0.hdslb.com/bfs/archive/sample_cover_2.jpg"
      ]
    }
  ],
  "page": 1,
  "pageSize": 100
}

Limits and notes

  • One query reaches at most 50 pages, about 1,000 videos; narrow or split the date range for popular keywords.
  • 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 matches everything collected for the range, including earlier tasks' results, so total_count can exceed task.completed; task.completed is what this task collected.
  • share_count, reply_count and dislike_count are always 0 for Bilibili videos; is_video is currently false although every record is a video.
  • num_results is the result count Bilibili reports, an estimate that can exceed what can be fetched.
  • Counts are as of collection. During a search Bilibili sometimes withholds later pages for a while, and the task then ends PARTIAL. How far back search can go is confirmed per project scope.
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

How many videos can one Bilibili search return?
At most 50 pages of 20 videos, about 1,000 per query. To cover more, split the date range into several tasks.
How long does a Bilibili search task take?
A search page takes about 4 to 10 seconds, so 50 pages take about 4 to 8 minutes, and a task may wait in a queue before it starts. Poll every 3 to 5 seconds and set an overall deadline.
Why is total_count larger than the number this task collected?
data is a keyword match over every Bilibili video collected for the date range, including videos from earlier tasks. task.completed is the number this task collected.
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.