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