# Bilibili Subtitles API (bilibili.subtitles)

- Canonical page: https://everyinfra.com/en/bilibili-api/subtitles
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "bilibili", "action": "subtitles", "params": {...}}
- Price: $0.000792 per call ($0.79 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

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.

## Health

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

## 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. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| video_id | platform-native meaning |
| title | Title. null when the platform has no titles (for example text-only posts). |
| author_name | Author's display name. |
| duration_seconds | Duration in seconds. null for content that is not video or audio. |
| duration_sec | platform-native meaning |
| language | Content language code (for example zh, en) as judged by the platform; it can be wrong. |
| 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). |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |
| segments | platform-native meaning |

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

```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": "subtitles",
        "params": {
            "url": "https://www.bilibili.com/video/BV1o84y1V7EY",
        },
    },
    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. `id`, `billing` and `quota` differ on every call, so only their shape is shown.

```text
{
  "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": { … }
}
```

## 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.

## 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
