Call it
curl https://api.peume.com/v1/call/youtube-video-captions-by-video-id-srt-xml-json3 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"videoId": "your videoId",
"languageCode": "",
"format": "srt"
}
}'const res = await fetch("https://api.peume.com/v1/call/youtube-video-captions-by-video-id-srt-xml-json3", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"videoId": "your videoId",
"languageCode": "",
"format": "srt"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/youtube-video-captions-by-video-id-srt-xml-json3",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"videoId": "your videoId",
"languageCode": "",
"format": "srt"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: youtube-video-captions-by-video-id-srt-xml-json3.
Parameters
videoIdRequiredstringThe unique identifier for a YouTube video.
languageCodestringCaption language code, such as en, zh-Hans, or a.en. Leave it empty to retrieve available caption tracks.
Example:
formatstringCaption output format. Available Values: - `srt`: SubRip caption format with timeline cues - `xml`: Original XML caption format - `json3`: YouTube original JSON caption structure - `txt`: Plain text without timeline cues One of: srt, xml, json3, txt.
srt · xml · json3 · txt
Example: srt
