Skip to main content
Most transcript tools only read a video’s existing caption track, and often only the English one. A Spanish talk with no captions comes back empty, and a Japanese interview whose only subtitles are an auto-translated English track comes back as English, not what was said. Importly takes the same URL for every language: it uses the caption track in the language you ask for when the video has one, and transcribes the audio itself when it doesn’t. This script transcribes a link in whatever language the media is in, prints which language that was, and shows how to force a specific one. It works on any public video or audio URL and needs no dependencies in Node, and requests in Python.

The code

Run it on a public video in any language:

Forcing a language

Leave language out to have the spoken language detected. Pass a code when you know it, or when you want a specific caption track on a multilingual video:
Regional codes work too: pt-BR and en-GB match that caption track, and speech-to-text transcribes in the base language, so language comes back as pt or en. See the full list of 99 supported languages.

What comes back

The response is the same shape for every language, whether the words came from captions or from speech-to-text:

Notes that save you a round trip

When the video has captions in the language you want, you get them for $0.003. When it doesn't, Importly transcribes the audio in that language at $0.01 per started minute, so a foreign-language video with no subtitles still returns a transcript instead of nothing. maxCostDollars caps that charge: a long video over the cap fails with MAX_COST_EXCEEDED rather than running over it. Speech-to-text transcribes, it doesn’t translate. Send language only when it’s the language actually spoken; asking for a different language than the audio gives a garbled transcript labelled with the wrong code. When you don’t know the language, leave it out and read it off result.language. Detection needs some speech to go on, so on a clip of a few seconds or one that’s mostly music, pass language when you can. Need the media file as well as the transcript? Add includeTranscript: true and transcriptLanguage to POST /import and one job gives you the file and its transcript. See transcripts inside an import.

Full reference: languages

How language behaves on captions and speech-to-text, and the 99 supported languages.