Bilibili Subtitles API

POST

API health

24h health
Normal
24h average time
—
  • Healthy / normal
  • Available
  • Limited
  • Mostly down
Normal

Get the subtitle text of a Bilibili video, with timed segments, a language code, the title, uploader and length in seconds. It covers what is said in the video, not viewer comments, and the language label can be wrong.

Bilibili Subtitles reads the transcription of what is said in one video and returns it in text, with the BV ID, title, uploader name, length in seconds and a language code. It turns a video's spoken content into searchable text, which researchers, translators and content teams use to summarize tutorials and reviews, check what an uploader claimed about a product, or build a corpus for topic analysis without watching every video.

Give url the video's full address, for example https://www.bilibili.com/video/<BV ID>. Read text next to duration_seconds: a short transcript on a long video suggests little speech. language comes from Bilibili and can be wrong. Viewer remarks are not part of this text; the discussion below the video and the on-screen comments are read through separate capabilities.

Price $0.56 per 1,000 requests ($0.000556 per call). Failed calls and empty results are not charged. Synchronous. For slow jobs add "mode": "async" to the body, take the job_id and poll.

AI prompt

Paste this into your AI assistant. It already holds this endpoint's parameters, response fields and an example request, so the assistant can ask what you need and then write the scraper.

Please help me write a data collection script with the EveryInfra Bilibili Subtitles endpoint (bilibili/subtitles).

Endpoint contract:
- Request: POST https://api.everyinfra.com/api/v1/social with the header Authorization: Bearer <API key>. Read the key from the EVERYINFRA_API_KEY environment variable and never hard-code it.
- In the request body, set platform to bilibili and action to subtitles, and put the parameters inside params.
- Required parameters:
  - url: 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, t…
- Returns one object. Main fields: video_id, title, author_name, duration_seconds, duration_sec, language, text, segments.
- Example request body:
{
  "platform": "bilibili",
  "action": "subtitles",
  "params": {
    "url": "https://www.bilibili.com/video/BV1o84y1V7EY"
  }
}
- Price: $0.56 per 1,000 requests; failed and empty results are not charged.
- For dozens or hundreds of targets, add "mode": "async" to the body: you get a job_id at once and poll GET https://api.everyinfra.com/api/v1/jobs/{job_id} for the result.
- On 422, fix the request using the suggested parameter names and allowed values in the error; on 429 or 503, wait for Retry-After and try again.

Before writing code, ask me which targets I need, how many, which fields, and what output format I want; then confirm the plan and the rough cost with me.

Request parameters

NameInTypeRequiredDefaultDescription
AuthorizationheaderstringYes-Bearer followed by your API key. Create it in the console; never put it in a URL or a code repository.
platformbodystringYesbilibiliPlatform identifier, fixed value.
actionbodystringYessubtitlesCapability identifier, fixed value.
urlbody.paramsNot declaredYes-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.

Code samples

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": "subtitles",
  "params": {
    "url": "https://www.bilibili.com/video/BV1o84y1V7EY"
  }
}'

[OpenAPI definition (JSON)]Samples read the key from the EVERYINFRA_API_KEY environment variable; copied code never contains your key.

Response example

Real response

Captured September 26, 2026 at 08:56 (UTC) by calling this API with the parameters in the code sample above. results and count are that call's real response with personal information (names, handles, avatars, profile links, contact details) removed. id, billing and quota differ on every call, so only their shape is shown.

json
{
  "id": "req_…",
  "platform": "bilibili",
  "action": "subtitles",
  "results": {
    "title": "【60集】儿童英文演讲视频,34个主题,小作文绝佳素材,每集30s短小精悍!主题包括:介绍自己、介绍家庭成员、介绍朋友、天气、梦想的工作、学校生活、学习计划、房 p01 English Speech _ All About Me",
    "author_name": "(已隐去)",
    "duration_seconds": 20,
    "language": "English",
    "text": "Everyone, nice to meet you. Let me introduce myself. My name is Julie Anderson. I'm nine years old. I'm from South Africa. I like pancakes and hot dogs. I like yellow. I like cats. Now you know more about me. I hope we can be friends.",
    "platform": "bilibili",
    "segments": [
      {
        "start": "00:00:00.830",
        "end": "00:00:10.660",
        "text": "Everyone, nice to meet you. Let me introduce myself. My name is Julie Anderson. I'm nine years old. I'm from South Africa."
      },
      {
        "start": "00:00:11.359",
        "end": "00:00:19.910",
        "text": "I like pancakes and hot dogs. I like yellow. I like cats. Now you know more about me. I hope we can be friends."
      }
    ]
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}

Response fields

Business data is in results. The table lists the fields a record can contain; values the platform does not show are never made up.

FieldMeaning
video_idKeeps the platform's own meaning
titleTitle. null when the platform has no titles (for example text-only posts).
author_nameAuthor's display name.
duration_secondsDuration in seconds. null for content that is not video or audio.
duration_secKeeps the platform's own meaning
languageContent language code (for example zh, en) as judged by the platform; it can be wrong.
textBody 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).
platformSource platform identifier, the same as platform in the request (for example xiaohongshu, tiktok).
segmentsKeeps the platform's own meaning

FAQ

Does text hold the whole transcript?

Yes. The transcription comes back in full, with HTML removed and nothing cut to an excerpt, so one call gives you the complete text. For long videos, split text into chunks before you summarize it or run topic models, and keep video_id on each chunk so every passage stays traceable to its video.

Can I trust the language code?

Use it as a hint. language is the code Bilibili assigns, such as zh or en, and the platform can get it wrong. If you route transcripts to translation or to language-specific analysis, run your own language detection on text and keep Bilibili's code next to the result.

How do I get views and likes for the same video?

Pass the same link to the Bilibili Video details capability, which returns the video's view, like, coin and favorite counts. video_id, the BV ID, is the key for joining the transcript with those numbers and with on-screen comments, whose rows carry the BV ID in their own video ID field.

Errors and billing

401
Missing or invalid key. Authentication runs before parameter checks, so unauthenticated requests never see the parameter schema.
422
Wrong parameter name or value. The error lists the parameters and allowed values this capability accepts and the closest match; it happens before any charge.
402
Insufficient balance. Top up first.
429
The account's per-minute request limit was reached (all of its API keys count together; a key's own lower limit applies first). Wait for Retry-After and try again; a rate package in the console raises the limit.
503
Could not complete right now. Any charge for the call goes back to your balance automatically, and the billing receipt in the response states the actual outcome, including when it is not yet known. Do not resend blindly.
200 empty
The request completed without data and is not charged (billing.reason = empty_result_refunded).

Official references

Used only to check objects and terms. They do not imply authorization or endorsement of EveryInfra by the platform.

  • Bilibili: Official Announcement on Upgrading AV Numbers to BV Identifiers ↗

    Bilibili's 2020 announcement defines BV identifiers as video submission IDs containing numbers and case-sensitive letters, distinguishing them from pure numeric AV numbers. This reference only explains video identifier types; this API accepts links per the format above and does not guarantee parsing for all legacy links or multi-part video segments.

    Checked 2026-09-04