Existing captions of a YouTube video or Short as plain text plus timed segments, by URL or ID (no speech-to-text; videos without captions are a free miss).
2 credits/ call
Never more than 8 credits a call.
You only pay when data comes back.
curl -X POST "https://api.primaryapi.com/v1/run/youtube.video_transcript" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://www.youtube.com/watch?v=bjVIDXPP7Uk"}'{
"output": {
"found": true,
"data": {
"durationSeconds": 1.92,
"transcript": "welcome back to the hell farm and t…",
"language": "English",
"segments": [
{
"startSeconds": 0.16,
"endSeconds": 1.92,
"text": "welcome back to the hell farm and t…"
}
], …
}
},
"credits": 2
}Input and output
3 fields
https://www.youtube.com/watch?v=bjVIDXP….5 fields
Good to know
A video without captions returns found: false with reason no_transcript. Is not billed. A miss is an answer, not an error, and it costs nothing.
The same key and credits work for every API.