抖音视频转文字(逐字稿)接口
通过 REST API 或 MCP 提取抖音公开视频的语音逐字稿与分段文案(当前按上游状态动态开放)。 通过 POST /v1/call/douyin.transcript 或 MCP 的 call 工具直接调用,每次成功消耗 14 积分,调用失败不扣费。
返回字段
| 字段 | 类型 | 含义 |
|---|---|---|
text | string | 完整口播逐字稿全文 |
segments | array | 带起止时间的分段列表 |
source | string | 字幕来源(原生字幕或语音识别) |
media_urls | array | 提取到的音视频源地址 |
请求示例
接口地址:POST https://socialtoai.app/v1/call/douyin.transcript,传入 id 参数及 Idempotency-Key 请求头即可:
curl -X POST "https://socialtoai.app/v1/call/douyin.transcript" \
-H "Authorization: Bearer $SOCIALTOAI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"id": "7345678901234567890"}'Python 示例
import os, uuid, requests
resp = requests.post(
"https://socialtoai.app/v1/call/douyin.transcript",
headers={
"Authorization": f"Bearer {os.environ['SOCIALTOAI_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={"id": "7345678901234567890"},
timeout=30,
)
print(resp.json())在 MCP 中使用
在 Claude、ChatGPT、Cursor 或 Codex 中连接 https://socialtoai.app/mcp 后,直接发送公开链接让 AI 调用 call 工具(op="douyin.transcript")即可获取结果。