抖音音乐详情接口
按音乐 ID 获取抖音背景音乐详情、MP3 播放地址、创作者与使用人数统计。每次 2 积分,失败不扣费。 通过 POST /v1/call/douyin.music 或 MCP 的 call 工具直接调用,每次成功消耗 2 积分,调用失败不扣费。
返回字段
| 字段 | 类型 | 含义 |
|---|---|---|
data.title | string | 音乐标题 |
data.author | string | 音乐创作者 |
data.play_url | string | 音频播放与下载地址 |
data.user_count | integer | 使用该音乐的作品数 |
请求示例
接口地址:POST https://socialtoai.app/v1/call/douyin.music,传入 id 参数及 Idempotency-Key 请求头即可:
curl -X POST "https://socialtoai.app/v1/call/douyin.music" \
-H "Authorization: Bearer $SOCIALTOAI_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"id": "7123456789012345678"}'Python 示例
import os, uuid, requests
resp = requests.post(
"https://socialtoai.app/v1/call/douyin.music",
headers={
"Authorization": f"Bearer {os.environ['SOCIALTOAI_API_KEY']}",
"Idempotency-Key": str(uuid.uuid4()),
},
json={"id": "7123456789012345678"},
timeout=30,
)
print(resp.json())在 MCP 中使用
在 Claude、ChatGPT、Cursor 或 Codex 中连接 https://socialtoai.app/mcp 后,直接发送公开链接让 AI 调用 call 工具(op="douyin.music")即可获取结果。