Get sentences in transcript
curl --request GET \
--url https://api.assemblyai.com/v2/transcript/{transcript_id}/sentences \
--header 'Authorization: <api-key>'import requests
url = "https://api.assemblyai.com/v2/transcript/{transcript_id}/sentences"
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}/sentences', 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}/sentences",
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}/sentences"
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}/sentences")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assemblyai.com/v2/transcript/{transcript_id}/sentences")
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_body{
"sentences": [
{
"text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US.",
"start": 250,
"end": 6350,
"confidence": 0.72412,
"words": [
{
"text": "Smoke",
"start": 250,
"end": 650,
"confidence": 0.72412,
"speaker": null
},
{
"text": "from",
"start": 730,
"end": 1022,
"confidence": 0.99996,
"speaker": null
},
{
"text": "hundreds",
"start": 1076,
"end": 1466,
"confidence": 0.99992,
"speaker": null
},
{
"text": "of",
"start": 1498,
"end": 1646,
"confidence": 1,
"speaker": null
}
],
"speaker": null
},
{
"text": "Skylines from Maine to Maryland to Minnesota are gray and smoggy.",
"start": 6500,
"end": 11050,
"confidence": 0.99819,
"words": [
{
"text": "Skylines",
"start": 6500,
"end": 7306,
"confidence": 0.99819,
"speaker": null
},
{
"text": "from",
"start": 7338,
"end": 7534,
"confidence": 0.99987,
"speaker": null
},
{
"text": "Maine",
"start": 7572,
"end": 7962,
"confidence": 0.9972,
"speaker": null
},
{
"text": "to",
"start": 8026,
"end": 8206,
"confidence": 1,
"speaker": null
},
{
"text": "Maryland",
"start": 8228,
"end": 8650,
"confidence": 0.5192,
"speaker": null
},
{
"text": "to",
"start": 8730,
"end": 8926,
"confidence": 1,
"speaker": null
}
],
"speaker": null
}
],
"id": "d5a3d302-066e-43fb-b63b-8f57baf185db",
"confidence": 0.9579390654205628,
"audio_duration": 281
}{
"error": "This is a sample error message"
}{
"error": "Authentication error, API token missing/invalid"
}{
"error": "Not found"
}{
"error": "Too Many Requests"
}{
"error": "Internal server error. Please retry your request. If the error persists, please contact support@assemblyai.com for more information."
}API reference
Get transcript sentences
To retrieve your transcriptions on our EU server, replace
api.assemblyai.com with api.eu.assemblyai.com.GET
/
v2
/
transcript
/
{transcript_id}
/
sentences
Get sentences in transcript
curl --request GET \
--url https://api.assemblyai.com/v2/transcript/{transcript_id}/sentences \
--header 'Authorization: <api-key>'import requests
url = "https://api.assemblyai.com/v2/transcript/{transcript_id}/sentences"
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}/sentences', 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}/sentences",
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}/sentences"
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}/sentences")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assemblyai.com/v2/transcript/{transcript_id}/sentences")
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_body{
"sentences": [
{
"text": "Smoke from hundreds of wildfires in Canada is triggering air quality alerts throughout the US.",
"start": 250,
"end": 6350,
"confidence": 0.72412,
"words": [
{
"text": "Smoke",
"start": 250,
"end": 650,
"confidence": 0.72412,
"speaker": null
},
{
"text": "from",
"start": 730,
"end": 1022,
"confidence": 0.99996,
"speaker": null
},
{
"text": "hundreds",
"start": 1076,
"end": 1466,
"confidence": 0.99992,
"speaker": null
},
{
"text": "of",
"start": 1498,
"end": 1646,
"confidence": 1,
"speaker": null
}
],
"speaker": null
},
{
"text": "Skylines from Maine to Maryland to Minnesota are gray and smoggy.",
"start": 6500,
"end": 11050,
"confidence": 0.99819,
"words": [
{
"text": "Skylines",
"start": 6500,
"end": 7306,
"confidence": 0.99819,
"speaker": null
},
{
"text": "from",
"start": 7338,
"end": 7534,
"confidence": 0.99987,
"speaker": null
},
{
"text": "Maine",
"start": 7572,
"end": 7962,
"confidence": 0.9972,
"speaker": null
},
{
"text": "to",
"start": 8026,
"end": 8206,
"confidence": 1,
"speaker": null
},
{
"text": "Maryland",
"start": 8228,
"end": 8650,
"confidence": 0.5192,
"speaker": null
},
{
"text": "to",
"start": 8730,
"end": 8926,
"confidence": 1,
"speaker": null
}
],
"speaker": null
}
],
"id": "d5a3d302-066e-43fb-b63b-8f57baf185db",
"confidence": 0.9579390654205628,
"audio_duration": 281
}{
"error": "This is a sample error message"
}{
"error": "Authentication error, API token missing/invalid"
}{
"error": "Not found"
}{
"error": "Too Many Requests"
}{
"error": "Internal server error. Please retry your request. If the error persists, please contact support@assemblyai.com for more information."
}Authorizations
Path Parameters
ID of the transcript
Response
Exported sentences
The unique identifier for the transcript
The confidence score for the transcript
Required range:
0 <= x <= 1The duration of the audio file in seconds
An array of sentences in the transcript
Show child attributes
Show child attributes
Was this page helpful?
⌘I