# B站 视频分 P API (bilibili.video_parts)

- Canonical page: [https://everyinfra.com/bilibili-api/video_parts](https://everyinfra.com/bilibili-api/video_parts?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "bilibili", "action": "video_parts", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: list
- Mode: sync; add "mode": "async" for slow tasks

## Health

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

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| url | not declared | yes | not declared | B 站视频完整链接 https://www.bilibili.com/video/<BV号>，或直接填 BV 号。一次返回这个视频的全部分 P，一个分 P 一行，只有一个分 P 的视频也返回一行；不翻页，不收 limit。认不出 BV 号时返回 422，不扣费。 |
| limit | integer (1–) | no | not declared | 这次调用最多返回的条数，整数，至少为 1；不传按默认值，实际返回可能少于这个数。 |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| cid | 分 P 编号（video_parts）：B 站给视频每个分 P 的数字编号。 |
| part_number | 第几个分 P（video_parts），从 1 起。 |
| title | 标题。平台无标题概念时（如纯文本帖）为 null。 |
| duration_seconds | 时长，单位秒。非视频/音频内容为 null。 |
| duration_sec | platform-native meaning |
| width | 画面宽度，像素（video_parts）。 |
| height | 画面高度，像素（video_parts）。 |
| video_id | 视频 BV 号。 |
| platform | 数据来源平台标识，与请求里的 platform 一致（如 xiaohongshu、tiktok）。 |

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

```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": "video_parts",
        "params": {
            "url": "https://www.bilibili.com/video/BV1DYjA6KEJ7",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

Real response to the example request above, captured 2026-11-21T07:17:18Z. `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": "video_parts",
  "results": [
    {
      "cid": "•••",
      "part_number": 1,
      "title": "《原神》「『空月之歌·谐谑』映夏！归乡？千灵节！」前瞻特别节目",
      "duration_seconds": 2583,
      "width": 2560,
      "height": 1440,
      "video_id": "BV1DYjA6KEJ7",
      "platform": "bilibili",
      "duration_sec": 2583
    }
  ],
  "count": 1,
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

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