Get subtitles for transcript
curl --request GET \
--url https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format} \
--header 'Authorization: <api-key>'import requests
url = "https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body1
00:00:13,160 --> 00:00:16,694
Last year I showed these two slides that demonstrate that the Arctic
2
00:00:16,734 --> 00:00:20,214
ice cap, which for most of the last 3 million years has been the size
3
00:00:20,254 --> 00:00:23,274
of the lower 48 states, has shrunk by 40%.
transcript
Get subtitles for transcript
Export your transcript in SRT or VTT format to use with a video player for subtitles and closed captions.
GET
/
v2
/
transcript
/
{transcript_id}
/
{subtitle_format}
Get subtitles for transcript
curl --request GET \
--url https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format} \
--header 'Authorization: <api-key>'import requests
url = "https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assemblyai.com/v2/transcript/{transcript_id}/{subtitle_format}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body1
00:00:13,160 --> 00:00:16,694
Last year I showed these two slides that demonstrate that the Arctic
2
00:00:16,734 --> 00:00:20,214
ice cap, which for most of the last 3 million years has been the size
3
00:00:20,254 --> 00:00:23,274
of the lower 48 states, has shrunk by 40%.
Authorizations
Path Parameters
ID of the transcript
The format of the captions Format of the subtitles
Available options:
srt, vtt Query Parameters
The maximum number of characters per caption
Response
The exported captions as text
The response is of type string.
Example:
"WEBVTT\n00:12.340 --> 00:16.220\nLast year I showed these two slides said that demonstrate\n00:16.200 --> 00:20.040\nthat the Arctic ice cap which for most of the last 3,000,000 years has been the\n00:20.020 --> 00:25.040\nsize of the lower 48 States has shrunk by 40% but this understates\n"