Search words in transcript
curl --request GET \
--url https://api.assemblyai.com/v2/transcript/{transcript_id}/word-search \
--header 'Authorization: <api-key>'import requests
url = "https://api.assemblyai.com/v2/transcript/{transcript_id}/word-search"
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}/word-search', 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}/word-search",
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}/word-search"
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}/word-search")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assemblyai.com/v2/transcript/{transcript_id}/word-search")
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{
"id": "d5a3d302-066e-43fb-b63b-8f57baf185db",
"total_count": 10,
"matches": [
{
"text": "smoke",
"count": 6,
"timestamps": [
[
250,
650
],
[
49168,
49398
],
[
55284,
55594
],
[
168888,
169118
],
[
215108,
215386
],
[
225944,
226170
]
],
"indexes": [
0,
136,
156,
486,
652,
698
]
},
{
"text": "wildfires",
"count": 4,
"timestamps": [
[
1668,
2346
],
[
33852,
34546
],
[
50118,
51110
],
[
231356,
232354
]
],
"indexes": [
4,
90,
140,
716
]
}
]
}{
"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
Word search
To search through a transcription created on our EU server, replace
api.assemblyai.com with api.eu.assemblyai.com.GET
/
v2
/
transcript
/
{transcript_id}
/
word-search
Search words in transcript
curl --request GET \
--url https://api.assemblyai.com/v2/transcript/{transcript_id}/word-search \
--header 'Authorization: <api-key>'import requests
url = "https://api.assemblyai.com/v2/transcript/{transcript_id}/word-search"
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}/word-search', 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}/word-search",
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}/word-search"
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}/word-search")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.assemblyai.com/v2/transcript/{transcript_id}/word-search")
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{
"id": "d5a3d302-066e-43fb-b63b-8f57baf185db",
"total_count": 10,
"matches": [
{
"text": "smoke",
"count": 6,
"timestamps": [
[
250,
650
],
[
49168,
49398
],
[
55284,
55594
],
[
168888,
169118
],
[
215108,
215386
],
[
225944,
226170
]
],
"indexes": [
0,
136,
156,
486,
652,
698
]
},
{
"text": "wildfires",
"count": 4,
"timestamps": [
[
1668,
2346
],
[
33852,
34546
],
[
50118,
51110
],
[
231356,
232354
]
],
"indexes": [
4,
90,
140,
716
]
}
]
}{
"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
Query Parameters
Keywords to search for
Response
Word search response
Was this page helpful?
⌘I