Exports
Download a finished transcript as plain text or as SRT or WebVTT subtitles, with speaker names.
Needs batch transcription
Exports read the transcripts of files, so they work once batch is open on your workspace (Batch transcription). A live session keeps no transcript to export.
Download a file
GET/v1/transcripts/{id}/export
A completed transcript as a text file or as subtitles, the same files the console downloads.
Send the id of a completed transcript, and the format you want:
ID=tr_ae35f8db719b4d9c # the id of your transcript
curl -sS -H "Authorization: Bearer $VATIS_KEY" "https://api.eu.vatis.tech/v1/transcripts/$ID/export?format=txt"Expected result: one paragraph for each turn, with its time and its speaker (trimmed). The files name the speakers for people: speaker_0 of the JSON is Speaker 1, speaker_1 is Speaker 2, and channel_0 is Channel 1.
[00:00] Speaker 1: Bună ziua, luați loc.
[00:02] Speaker 2: Am venit pentru contractul din 12 martie.To save the file, give it a name of your own, or keep the one the API gives in the Content-Disposition header, <id>.<format> (in cURL, -o and -OJ):
curl -sS -H "Authorization: Bearer $VATIS_KEY" -o speech.srt "https://api.eu.vatis.tech/v1/transcripts/$ID/export?format=srt"
curl -sS -H "Authorization: Bearer $VATIS_KEY" -OJ "https://api.eu.vatis.tech/v1/transcripts/$ID/export?format=txt×tamps=false"In your own code, as a function that takes the options:
# WebVTT subtitles with one line of at most 5 words per caption, saved as speech.vtt
curl -sS -H "Authorization: Bearer $VATIS_KEY" -o speech.vtt \
"https://api.eu.vatis.tech/v1/transcripts/$ID/export?format=vtt&lines=1&words_per_line=5"Options
| Parameter | Formats | Values | Default | What it does |
|---|---|---|---|---|
format | txt, srt, vtt | required | Plain text, SRT subtitles, or WebVTT subtitles. | |
timestamps | txt | true, false | true | Each paragraph starts with its time, [01:05], or [1:02:03] past the first hour. |
speakers | all | true, false | true | Name the speaker: Speaker 1 for speaker_0, Channel 1 for channel_0. A transcript without speakers has none to name. |
lines | srt, vtt | 1 to 3 | 2 | Lines per caption. |
words_per_line | srt, vtt | 3 to 12 | 7 | Words per line. |
| Format | Content-Type |
|---|---|
txt | text/plain; charset=utf-8 |
srt | application/x-subrip; charset=utf-8 |
vtt | text/vtt; charset=utf-8 |
- The answer is the file, in UTF-8, with
Content-Disposition: attachment; filename="<id>.<format>". - Booleans are
trueorfalse(also1or0). An empty value counts as not sent.
What the files look like
For the example of The transcript object, format=txt:
[00:00] Speaker 1: Bună ziua, luați loc.
[00:02] Speaker 2: Am venit pentru contractul din 12 martie.format=srt:
1
00:00:00,120 --> 00:00:01,700
Speaker 1: Bună ziua, luați loc.
2
00:00:02,480 --> 00:00:05,100
Speaker 2: Am venit pentru contractul din 12 martie.format=vtt:
WEBVTT
1
00:00:00.120 --> 00:00:01.700
<v Speaker 1>Bună ziua, luați loc.
2
00:00:02.480 --> 00:00:05.100
<v Speaker 2>Am venit pentru contractul din 12 martie.How the files are made
- Text: a paragraph for each turn (the consecutive segments of one speaker; without speakers, each segment), a blank line between paragraphs, and a newline at the end.
- Captions follow the segments and their word times. A caption never spans a change of speaker or a pause longer than 1 s, and ends after a sentence where it can. A sentence too long for one caption is split into even parts, after a comma where possible; short sentences are joined while the caption is less than half full.
- Without punctuation (
punctuation=false), phrases are cut at pauses longer than 1 s only, and a phrase too long for one caption is split where the speaker pauses for 0.3 s or more. - A caption stays on screen at most about 0.42 s for each word it can hold, from 3 to 7 s (6 s at 2 lines of 7 words), and at least 0.3 s. Its lines are balanced. When two people talk at once, their captions overlap in time, as both formats allow, numbered by their start.
- Speaker names: SRT starts a caption with
Speaker 1:where the speaker changes (the first caption too). WebVTT gives every caption a voice tag,<v Speaker 1>, which players can show or style, and escapes&,<and>in the text. - Times come from the words:
00:00:01,250in SRT,00:00:01.250in WebVTT. - An empty transcript gives an empty file (
WEBVTTalone forvtt).
Files with the transcript itself
An export reads a transcript the API keeps. With store=false nothing is kept, so ask for the files with the request instead: exports lists the formats, and the finished transcript carries them, made with the default options. store=false needs a webhook, whose delivery's data is then the only copy (Webhooks).
WEBHOOK_ID=wh_a97581d905c54b46 # the "id" of your webhook
curl -sS -H "Authorization: Bearer $VATIS_KEY" https://api.eu.vatis.tech/v1/speech-to-text \
-F model_id=vatis_ro_v9 -F diarize=true -F webhook_id=$WEBHOOK_ID -F store=false -F exports=txt,srt \
-F file=@speech.wavExpected result: the answer comes at once, with the transcript queued. When it is done, the delivery's data (trimmed) is the transcript, with the files in exports:
{"id": "tr_118a9bbfc46f4df7", "status": "completed", "text": "...", "words": [...], "segments": [...],
"speakers": ["speaker_0", "speaker_1"],
"exports": {"txt": "[00:00] Speaker 1: Bună ziua, luați loc.\n\n[00:02] Speaker 2: ...",
"srt": "1\n00:00:00,120 --> 00:00:01,700\nSpeaker 1: Bună ziua, luați loc.\n\n2\n..."}}- A transcript the API keeps carries
exportstoo when you asked for them: in the webhook delivery andGET /v1/transcripts/{id}, but not in the list. srtorvttwithtimestamps=noneis refused: subtitles need word times (400invalid_parameter,paramexports).
Errors
| Status and code | When | What to do |
|---|---|---|
400 invalid_parameter | A parameter unknown, sent twice, out of range, or not one the format takes (lines with txt, timestamps with srt); or subtitles of a transcript made with timestamps=none (param format). | Fix the parameter param names. |
400 missing_parameter | No format. | Add it. |
404 not_found | An unknown or deleted transcript, one past its 7 days, one sent with store=false, or another key's to a Member key. | Check the id. With store=false, ask for exports in the request. |
409 not_completed | The transcript is still queued or processing, or it failed. | Wait until it is completed. |
Next steps
- Speakers: get the speaker names into your files.
- Manage transcripts: read, list and delete transcripts.
- Webhooks: have each transcript, and its files, posted to your server.