Get OCR text
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");curl_easy_setopt(hnd, CURLOPT_URL, "https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks");
struct curl_slist *headers = NULL;headers = curl_slist_append(headers, "Authorization: Bearer <token>");curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Get, RequestUri = new Uri("https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks"), Headers = { { "Authorization", "Bearer <token>" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks"
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(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks")) .header("Authorization", "Bearer <token>") .method("GET", HttpRequest.BodyPublishers.noBody()) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks") .get() .addHeader("Authorization", "Bearer <token>") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'GET', url: 'https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr', params: {format: 'blocks'}, headers: {Authorization: 'Bearer <token>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val request = Request.Builder() .url("https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks") .get() .addHeader("Authorization", "Bearer <token>") .build()
val response = client.newCall(request).execute()use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr";
let querystring = [ ("format", "blocks"), ];
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.get(url) .query(&querystring) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request GET \ --url 'https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks' \ --header 'Authorization: Bearer <token>'wget --quiet \ --method GET \ --header 'Authorization: Bearer <token>' \ --output-document \ - 'https://api.focal.inc/v1/media/786beeda-55ac-4025-bf6e-43b2918e84a9/ocr?format=blocks'Returns the text detected in the media as one assembled document — all blocks in reading/playback order, no pagination. Image media yields blocks with a reading-order index; video media yields blocks with an on-screen time range. Check status to distinguish not-yet-analyzed (pending) from analyzed-with-no-text (completed with no blocks). Pass format=text for a single newline-joined string suited to LLM prompts.
Kept as a separate request — like /download — so list and get traffic never carries the OCR payload.
Required scope: media:read. Rate-limit cost: 5.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Example
786beeda-55ac-4025-bf6e-43b2918e84a9Query Parameters
Section titled “Query Parameters”Response form: blocks (default) returns the structured block array; text returns all detected text as one newline-joined string instead.
Responses
Section titled “Responses”OK
object
object
Whether the analysis feature has run for this media:
completed— analysis ran; an empty result means nothing was found (e.g. no speech, no visible text)pending— the media hasn’t been analyzed (yet)not_applicable— this media type is never analyzed, so no data will ever appear
The detected text blocks in reading/playback order. Present unless format=text was requested. Empty when status isn’t completed, or when analysis found no text.
object
Reading order of the block within the image, from 0.
The detected text.
object
Seconds into the video where the text appears. null when the pipeline couldn’t parse a timestamp.
Seconds into the video where the text disappears. null when the pipeline couldn’t parse a timestamp.
The detected text.
All detected text as one newline-joined string — a token-lean form for feeding to an LLM. Present only when format=text was requested.
Example
{ "data": { "media_id": "786beeda-55ac-4025-bf6e-43b2918e84a9", "status": "pending", "blocks": [ { "type": "image", "index": 0, "content": "ALDER & PINE" } ], "text": "ALDER & PINE\nSpring 2027\nShop the collection" }}The request was malformed (invalid cursor, unknown type, validation failure, etc.). error.code is bad_request.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "bad_request", "message": "Invalid request body", "details": [ { "field": "space_id", "issue": "Invalid UUID" } ] }}Missing, invalid, or disabled token. error.code is unauthenticated.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "unauthenticated", "message": "Bearer token is missing or invalid" }}The token doesn’t have the scope this endpoint requires. error.code is forbidden.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "forbidden", "message": "Token doesn't have the required scope" }}Resource doesn’t exist or is outside the token’s space allow-list. The two cases share a response shape so a restricted token can’t probe for the existence of out-of-scope spaces. error.code is not_found.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "not_found", "message": "Not found" }}Rate limit exceeded. error.code is rate_limited. Wait the number of seconds in the Retry-After header before retrying. Quotas are per-token; see the “Rate limiting” section at the top of this document.
Canonical error envelope. code is stable across releases and intended for programmatic handling; message is human-readable. details only appears for validation failures and lists the offending fields.
object
object
object
Example
{ "error": { "code": "rate_limited", "message": "Rate limit of 1000 units per 60s exceeded (this request cost 5)" }}Headers
Section titled “Headers”Example
12Seconds to wait before retrying.