Build a language report
Languages live on each product. Combine these reads to build a report.
Codes are BCP-47 (en, es, pt-BR, …) — see Language codes.
What to read
Section titled “What to read”| Kind | Endpoint | Gives you |
|---|---|---|
| Source locale | GET /videos/{videoId} + GET /videos/{videoId}/transcript | defaultLanguageCode, transcript readiness |
| Dubbed audio | GET /videos/{videoId}/dubs | Every dub language with status, completion, jobId |
| Caption-only | GET /videos/{videoId}/jobs (type: captions) | captions_{videoId}_{lang} — or probe GET /subtitles/{lang} |
| Playback manifests | urlMulti on video (when set) | Locale keys → replay URLs — not dub metadata |
| Orchestration | GET /videos/{videoId}/jobs | Import, transcript, dub, captions, shorts, thumbnail, packaging, download |
1. Source language
Section titled “1. Source language”curl -sS "$BRAIV_API_BASE/videos/$VIDEO_ID" \ -H "Authorization: Bearer $BRAIV_API_KEY"Use defaultLanguageCode. The nested transcript.language on list/get is the same source locale, not translations.
Confirm transcript readiness:
curl -sS "$BRAIV_API_BASE/videos/$VIDEO_ID/transcript" \ -H "Authorization: Bearer $BRAIV_API_KEY"2. Dubbed languages (primary)
Section titled “2. Dubbed languages (primary)”curl -sS "$BRAIV_API_BASE/videos/$VIDEO_ID/dubs" \ -H "Authorization: Bearer $BRAIV_API_KEY"Example shape:
{ "dubs": [ { "language": "es", "product": "plus", "status": "ready", "completion": "full_ready", "jobId": "dub_uv_123_es_plus" } ]}Prefer completion (preview_ready, full_ready, awaiting_credits) for reporting. For one locale + audioUrl:
curl -sS "$BRAIV_API_BASE/videos/$VIDEO_ID/dubs/es?product=plus" \ -H "Authorization: Bearer $BRAIV_API_KEY"3. Caption translations
Section titled “3. Caption translations”After you request caption translation, GET /videos/{videoId}/jobs includes captions_* jobs. Poll:
curl -sS "$BRAIV_API_BASE/jobs/captions_${VIDEO_ID}_fr" \ -H "Authorization: Bearer $BRAIV_API_KEY"Language is in details.language on the job response.
If you know candidate langs — probe subtitles:
curl -sS "$BRAIV_API_BASE/videos/$VIDEO_ID/subtitles/fr?format=srt" \ -H "Authorization: Bearer $BRAIV_API_KEY"200 = subtitles exist; 202 = still processing.
4. Jobs as a secondary index
Section titled “4. Jobs as a secondary index”curl -sS "$BRAIV_API_BASE/videos/$VIDEO_ID/jobs" \ -H "Authorization: Bearer $BRAIV_API_KEY"Dub languages are encoded in ids: dub_{videoId}_{lang}_{product} — see Job id format. Prefer GET /dubs for structured language and status; use jobs mainly for polling.
Example aggregate (client-built)
Section titled “Example aggregate (client-built)”{ "videoId": "uv_123", "sourceLanguage": "en", "dubs": [ { "language": "es", "product": "plus", "completion": "full_ready" } ], "captionLanguages": ["fr"]}captionLanguages comes from captions_* jobs or subtitle probes. GET /videos gives the source language; GET /packaging is title, description, and poster.