/v1/call/bilibili.transcriptB 站视频转文字(文案提取、逐字稿)接口
B 站独有的接口。
给一个 B 站视频的链接或 BV 号,返回视频里说的话。B 站视频转文字(文案提取、逐字稿) API(数据接口)每次调用 14 积分(约 $0.028–$0.047),失败不扣。用 HTTP 调用,或让 AI 客户端通过 MCP 调用。
最近更新:
调用 B 站视频转文字(文案提取、逐字稿),你会拿到什么。
取自一次录制的返回。
录制的一次调用返回了下面这个对象。名称和正文在示例里去掉了,数字是录制时的真实值。
| 字段 | 录制时的值 |
|---|---|
| title | null |
| url | null |
| rank | null |
| heat | null |
| fields.status | done |
| fields.job | null |
| fields.retry_after_seconds | null |
| fields.lang | null:B 站给不了 |
| fields.text | 示例里已去掉 |
| fields.duration | 142.613 |
| fields.segments | 2 项 |
| fields.post.title | 示例里已去掉 |
| fields.post.text | 示例里已去掉 |
| fields.post.url | 示例里已去掉 |
| fields.post.published_at | 2026-09-16T03:30:00.000Z |
| fields.post.duration | 143 |
| fields.post.author.id | 示例里已去掉 |
| fields.post.author.name | 示例里已去掉 |
| fields.post.metrics.likes | 7,530 |
| fields.post.metrics.comments | 1,073 |
每次 14 积分(≈ $0.028–$0.047),$10 约够 214 次。
B 站视频转文字(文案提取、逐字稿)的请求与返回
curl https://api.socialtoai.com/v1/call/bilibili.transcript \ -H "Authorization: Bearer $SOCIALTOAI_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "id": "BV1ECeJ65EZS" }'import osimport uuidimport requestsresponse = requests.post( "https://api.socialtoai.com/v1/call/bilibili.transcript", headers={ "Authorization": f"Bearer {os.environ['SOCIALTOAI_API_KEY']}", # A new key for each request; the same one again retries it without paying twice. "Idempotency-Key": str(uuid.uuid4()), }, json={ "id": "BV1ECeJ65EZS", },)print(response.json())# 已经通过 MCP 接好了?直接用大白话问。用“B 站视频转文字(文案提取、逐字稿)”接口(bilibili.transcript),参数是 id: BV1ECeJ65EZS。# 你的 AI 会调用 call 工具,参数是:{ "id": "BV1ECeJ65EZS"}speakers{ "op": "bilibili.transcript", "platform": "bilibili", "status": "ok", "items": [ { "platform": "bilibili", "id": "…", "ref": "…", "approx": [], "extra": {}, "type": "entry", "entry_type": "transcript", "title": null, "url": null, "rank": null, "heat": null, "fields": { "status": "done", "job": null, "retry_after_seconds": null, "lang": null, "text": "…", "duration": 142.613, "segments": [ { "start": 0.59, "end": 3.35, "text": "…", "speaker": null }, { "start": 3.55, "end": 5.15, "text": "…", "speaker": null } ], "post": { "title": "…", "text": "…", "url": "https://example.com/…", "published_at": "2026-09-16T03:30:00.000Z", "duration": 143, "author": { "id": "…", "name": "…" }, "metrics": { "likes": 7530, "comments": 1073 } } } } ], "unavailable": ["fields.lang"], "cost_credits": 14}- entry_type
- transcript
- status
- done
- job
null- retry_after_seconds
null- lang
null- text
- …
- duration
- 142.613
示例里的名称和正文已去掉,数字是录制时的真实值。
B 站视频转文字(文案提取、逐字稿)的参数。
4 个,0 个必填。
用 POST 发一个 JSON 请求体。Key 放在 Authorization 请求头里,不要放进网址。
| 名称 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| id | string | 几个里给一个 | — | 视频的 BV 号,BV1 开头共 12 位 |
| url | string | 几个里给一个 | — | 视频链接,原样粘贴即可:视频页链接 www.bilibili.com/video/BV…、手机版 m.bilibili.com/video/BV…,或 App 复制出来的 b23.tv 短链接。短链接由我们打开一次,看它跳到哪个视频 |
| speakers | string | 选填 | "no" | 要不要区分说话人:yes 在每一段标出是谁说的(1、2…),no 不分"yes""no" |
| job | string | 几个里给一个 | — | 长视频(超过 5 分钟、2 小时以内),或一次调用里没识别完的视频,按链接调用时返回的 job:过一会儿带着它再调这个接口取文字,提交后 24 小时内有效。和 id、url 三样给一样;带 job 时 speakers 按提交时的 |
这些值从哪里拿。
id视频的 BV 号,BV1 开头共 12 位(例如 BV1ECeJ65EZS)
这些接口返回的每一条都带 ref,原样填进来即可:
也可以直接填网页链接,返回里的 url 字段就是。
job长视频(超过 5 分钟、2 小时以内),或一次调用里没识别完的视频,按链接调用时返回的 job:过一会儿带着它再调这个接口取文字,提交后 24 小时内有效。和 id、url 三样给一样;带 job 时 speakers 按提交时的(例如 tr_047_BiliExampleJob000000)
平台上没有别的接口返回它,按上面的说明从网页或链接里取。
B 站视频转文字(文案提取、逐字稿)返回的字段。
B 站给不了的标出来了。
| 字段 | 类型 | 含义 |
|---|---|---|
| items[].extra | object | 平台在下面这些字段之外给的内容,用平台自己的字段名(IP 属地、uid、有没有橱窗等),每个是什么见接口的 extra_fields;没有就是空对象。评论和评价里不会有写的人是谁。 |
| items[].title | string | 条目的标题或名称。 |
| items[].url | string | 能打开它的链接;平台的列表不带链接时为 null。 |
| items[].rank | integer | 榜上的名次,从 1 起。 |
| items[].heat | integer | 平台给的热度值。 |
| items[].fields.status | string | done:文字已经在这里。processing:长视频还在识别,文字还没有,这次没有扣费。 |
| items[].fields.job | string | processing 时才有:过 retry_after_seconds 秒后用同一个条目只带 job 再调取文字,24 小时内有效;取到文字时才扣费,同一个 job 再取不扣。 |
| items[].fields.retry_after_seconds | integer | processing 时才有:建议多少秒后再来取。 |
| items[].fields.lang | string始终 null | 逐字稿的语言。 |
| items[].fields.text | string | 全文。 |
| items[].fields.duration | number | 转写的音视频时长,秒。 |
| items[].fields.segments | array | 带时间的分段:start、end、text 和 speaker(要求区分说话人时是 1、2…)。 |
| items[].fields.post.title | string | 这段话所在内容的标题;没有标题的平台为 null。 |
| items[].fields.post.text | string | 它的文案或简介。 |
| items[].fields.post.url | string | 它的链接。 |
| items[].fields.post.published_at | string | 发布时间,ISO 8601(UTC)。 |
| items[].fields.post.duration | number | 平台写的视频时长,秒。 |
| items[].fields.post.author.id | string | 作者编号。 |
| items[].fields.post.author.name | string | 作者的名字。 |
| items[].fields.post.metrics.likes | integer | 点赞数。 |
| items[].fields.post.metrics.comments | integer | 评论数。 |
nullB 站给不了的字段null 的意思是“B 站没给这个值”,不要当成 0。这些字段在这个调用里始终是 null:
fields.lang逐字稿的语言。
每一条另有 platform、id、ref、approx、type;items 外面的部分每个调用都一样。 返回格式
B 站视频转文字(文案提取、逐字稿)的翻页与计费。
每把 Key 每秒 5 次,购买后 20 次;超出不扣费。 频率限制
失败的调用 0 积分,不会自动重试。 错误码
接口上次实测:2026-11-22。每次调用从平台读取,返回里的 fetched_at 是读取时间;同一把 Key 5 分钟内重发完全相同的请求算重放(replayed: true),0 积分,返回第一次读到的结果。
接好 MCP 后,这样问就会用到 B 站视频转文字(文案提取、逐字稿)。
给一个 B 站视频的链接或 BV 号,返回视频里说的话:BV1ECeJ65EZS
14 积分call {"op":"bilibili.transcript","id":"BV1ECeJ65EZS"}给一个 B 站视频的链接或 BV 号,返回视频里说的话:BV1ECeJ65EZS,speakers 取 yes。
14 积分call {"op":"bilibili.transcript","id":"BV1ECeJ65EZS","speakers":"yes"}在 B 站上搜和“机械键盘”有关的视频,再对前 3 个结果:给一个 B 站视频的链接或 BV 号,返回视频里说的话。
44 积分search {"platform":"bilibili","query":"机械键盘"}call {"op":"bilibili.transcript","id":"<ref>"} × 3
交给你的 AI。
复制给 Claude 或 ChatGPT。
怎么接用 SocialToAI 的 MCP 服务(https://mcp.socialtoai.com/mcp)完成这件事:给一个 B 站视频的链接或 BV 号,返回视频里说的话:BV1ECeJ65EZS调用 call 工具,参数是 {"op":"bilibili.transcript","id":"BV1ECeJ65EZS"}。必填:id、url、job;可选:speakers(yes、no)。要查多个就一个一个调用,每个 14 积分。开跑前先算出总共要多少积分,问我同意了再调用。拿到结果后,可以接着调:comments(评论),用返回的 ref 或 username。如果还没接上 SocialToAI,告诉我怎么接,不要让我把 Key 贴进对话。回答时附上你用到的每一条的链接,最后告诉我花了多少积分。接好 MCP 后把这段话贴进对话。里面没有 Key:在 Claude 和 ChatGPT 里登录授权,其他客户端把 Key 放在请求头里。
同名的接口,换个平台。
全部平台和价格/v1/call/bilibili.transcript{ "id": "BV1ECeJ65EZS" }14 积分每次调用接着看。
官方能做什么、谁能申请、多少钱,带来源。
让你的 AI 直接读 B 站。