Get a segment
curl --request GET \
--url https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}', 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.rask.ai/v3/projects/{project_id}/segments/{segment_id}",
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: Bearer <token>"
],
]);
$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.rask.ai/v3/projects/{project_id}/segments/{segment_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.rask.ai/v3/projects/{project_id}/segments/{segment_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "segment",
"id": "8b3d1e9f-6a2c-4d7e-b5f1-3c9e7a1d5b22",
"project_id": "6f1c2b7e-8a4d-4e3f-9b5c-1d0a7e2f3c58",
"start_seconds": 3.4,
"end_seconds": 6.8,
"speaker_id": "SPEAKER_01",
"speaker_label": "Speaker 2",
"source": {
"text": "Today we cover the new dubbing features.",
"language": "en"
},
"translation": {
"text": "Hoy repasamos las nuevas funciones de doblaje.",
"language": "es-es"
},
"words": {
"source": [
{
"text": "Today",
"start_seconds": 3.4,
"end_seconds": 3.71
},
{
"text": "we",
"start_seconds": 3.71,
"end_seconds": 3.85
}
],
"translation": [
{
"text": "Hoy",
"start_seconds": 3.4,
"end_seconds": 3.66
}
]
},
"needs_attention": false,
"status": "ready",
"dub_state": "outdated",
"audio": null,
"selected_variant_id": "v-8b3d1e9f-0",
"translation_variants": [
{
"id": "v-8b3d1e9f-0",
"text": "Hoy repasamos las nuevas funciones de doblaje.",
"recommended": true,
"speed_ratio": 1.04,
"predicted_duration_seconds": 3.3
},
{
"id": "v-8b3d1e9f-1",
"text": "Hoy veremos las novedades de doblaje.",
"recommended": false,
"speed_ratio": 0.92,
"predicted_duration_seconds": 2.9
}
],
"processing_started_at": null,
"etag": "\"s-a197265875140819\""
}Segments
Get a segment
Returns one segment of the live transcript with its ETag.
GET
/
projects
/
{project_id}
/
segments
/
{segment_id}
Get a segment
curl --request GET \
--url https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}', 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.rask.ai/v3/projects/{project_id}/segments/{segment_id}",
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: Bearer <token>"
],
]);
$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.rask.ai/v3/projects/{project_id}/segments/{segment_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.rask.ai/v3/projects/{project_id}/segments/{segment_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rask.ai/v3/projects/{project_id}/segments/{segment_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"object": "segment",
"id": "8b3d1e9f-6a2c-4d7e-b5f1-3c9e7a1d5b22",
"project_id": "6f1c2b7e-8a4d-4e3f-9b5c-1d0a7e2f3c58",
"start_seconds": 3.4,
"end_seconds": 6.8,
"speaker_id": "SPEAKER_01",
"speaker_label": "Speaker 2",
"source": {
"text": "Today we cover the new dubbing features.",
"language": "en"
},
"translation": {
"text": "Hoy repasamos las nuevas funciones de doblaje.",
"language": "es-es"
},
"words": {
"source": [
{
"text": "Today",
"start_seconds": 3.4,
"end_seconds": 3.71
},
{
"text": "we",
"start_seconds": 3.71,
"end_seconds": 3.85
}
],
"translation": [
{
"text": "Hoy",
"start_seconds": 3.4,
"end_seconds": 3.66
}
]
},
"needs_attention": false,
"status": "ready",
"dub_state": "outdated",
"audio": null,
"selected_variant_id": "v-8b3d1e9f-0",
"translation_variants": [
{
"id": "v-8b3d1e9f-0",
"text": "Hoy repasamos las nuevas funciones de doblaje.",
"recommended": true,
"speed_ratio": 1.04,
"predicted_duration_seconds": 3.3
},
{
"id": "v-8b3d1e9f-1",
"text": "Hoy veremos las novedades de doblaje.",
"recommended": false,
"speed_ratio": 0.92,
"predicted_duration_seconds": 2.9
}
],
"processing_started_at": null,
"etag": "\"s-a197265875140819\""
}When to use: before updateSegment, to get the current ETag.
Side effects: None.
Cost: Free.
Idempotency: safe and pure (never writes); retry freely.
Paid text: on a project created through v3, 409
dub_payment_required until a dub of that project is charged.
Required scopes: transcripts:read
Errors: transcript_not_ready (409), dub_payment_required (409)Authorizations
Path Parameters
Query Parameters
Response
OK: Segment.
A transcript segment.