Add translate_to to a TranscriptAPI request. You get the subtitles of any YouTube video in the language you ask for, timestamps intact, in about 7 seconds for a 20-minute video.
curl "https://api.transcriptapi.io/transcript?video_id=dQw4w9WgXcQ&translate_to=de" \ -H "Authorization: Bearer $API_KEY"
Get a free key (20 credits, no card). No code needed? The free YouTube transcript translator does the same thing in the browser.
Why translating subtitles with an LLM is harder than it looks
The obvious approach is to send the whole transcript to a model in one call and ask for the same lines back in another language. It works, and it is slow. For a 19-minute video (286 caption segments) that single call took 35 seconds. The model has to write every line one after another, and many HTTP clients and serverless functions give up at 30.
Splitting the transcript into chunks and translating them in parallel fixes the speed. We measured 6.6 seconds for the same video with chunks of 40 segments, eight at a time. But it creates new problems:
- Smaller chunks drop lines. With less context, the model is more likely to merge two short captions or skip one. At 25 segments per chunk it was slightly faster, but 6 of 286 lines came back untranslated, against 1 at 40.
- A missing line shifts the whole timeline unless every line keeps its absolute position. Then each subtitle after it is shown next to the wrong moment in the video.
- Each chunk repeats the instructions, which adds about 8% to the input tokens.
- Cost follows length. Tokens scale with the number of segments, so a flat price per translation under-charges long videos and over-charges short ones.
What translate_to does for you
All of that tuning is behind one parameter: chunk size, concurrency, absolute line positions, and a fallback that keeps the original line when the model drops one, so the timeline never shifts.
import os, requests
r = requests.get(
"https://api.transcriptapi.io/transcript",
params={"video_id": "dQw4w9WgXcQ", "translate_to": "es"},
headers={"Authorization": f"Bearer {os.environ['TRANSCRIPTAPI_KEY']}"},
timeout=60,
)
r.raise_for_status()
print(r.json())- Works from any caption language the video has, creator-uploaded or auto-generated, into any language code you pass.
- Translated SRT and VTT files come from the MCP server (
get_youtube_transcriptwithtranslate_to) and the free translator tool. You can also just ask Claude or ChatGPT for “Spanish subtitles for this video”. - Parameters and the response format are in the API docs.
What it costs
One credit for the transcript, plus one credit per 40 segments for the translation (at least 2), so 3 credits minimum. A 10-minute video is usually 5–7 credits. Failed requests are refunded. See pricing: the $49 plan has 25,000 credits a month, and one-time top-ups start at $10.
Start with 20 free credits, which is enough to translate a few videos and check the quality in your language.
Frequently asked questions
How do I translate YouTube subtitles automatically?
Request the transcript from TranscriptAPI with translate_to set to the target language code, for example translate_to=de. You get the translated segments back with the original timestamps, for any public video that has captions in any language.
Are the timestamps kept when the transcript is translated?
Yes. Every translated line keeps the start time of its source segment. If the model leaves a line out, the original line is kept in its place so the timeline never shifts.
How long does a translation take?
About 7 seconds for a 19-minute video in our measurements, and roughly 12 seconds for an hour-long one, because the transcript is translated in parallel chunks.
How much does translating a transcript cost?
One credit for the transcript plus one credit per 40 segments for the translation, with a minimum of 2 for the translation part, so 3 credits minimum. A 10-minute video is usually 5–7 credits.
Can I get translated SRT or VTT subtitle files?
Yes, through the MCP server (get_youtube_transcript with translate_to and format srt or vtt) and the free YouTube transcript translator. The REST endpoint returns JSON segments.