/desearch/youtube/transcript/{video_id}Retrieve the public captions of a YouTube video or Short as plain text and timestamped segments. A video without captions returns 404 and is not charged. Billed per request, including an empty page. A 404, a 422 and a 5xx are not charged. Billing metadata: successful billable responses include the `X-Desearch-Cost-Usd`, `X-Desearch-Usage-Count`, `X-Desearch-Service`, and `X-Desearch-Currency` headers. JSON object responses also include optional `cost_usd`, `usage_count`, `service`, and `currency` fields. Current prices are at https://desearch.ai/pricing. JSON arrays, text, and streaming responses keep their body shape and expose billing metadata only through headers.
Base URL
https://api.desearch.aiUse Retrieve YouTube Transcript when your application needs search-grounded AI results without maintaining its own crawler, social-data pipeline, or retrieval infrastructure. The endpoint returns structured data that can be consumed by agents, research tools, dashboards, and retrieval-augmented generation workflows. Keep the request focused on the minimum fields your workflow needs so responses remain fast and easy to validate.
Send requests to GET /desearch/youtube/transcript/{video_id} with your Desearch API key in the authorization header. Treat the key as a server-side secret, validate all required parameters before sending the request, and handle non-2xx responses explicitly. Production integrations should use sensible timeouts, retry only transient failures with backoff, and record the response status and request identifier for troubleshooting.
Test the example request below before integrating it into a larger workflow. Confirm that the returned fields, links, and timestamps meet your freshness requirements, then add schema validation at the application boundary. For agentic systems, preserve source URLs with the generated answer so users can inspect evidence and your application can avoid presenting unsupported claims.
video_idstringrequiredYouTube video or Short ID, or its full URL
languagestringCaption language code, for example `en` or `es`. Omit for YouTube's default track.
Your API key is sent in the Authorization header.
curl -X GET "https://api.desearch.ai/desearch/youtube/transcript/dQw4w9WgXcQ" \
-H "Authorization: YOUR_API_KEY" \
-H "Content-Type: application/json"{
"videoId": "dQw4w9WgXcQ",
"type": "string",
"url": "string",
"language": "English",
"text": "string",
"segments": [
{
"text": "string",
"startMs": 160,
"endMs": 1920,
"startText": "0:00"
}
]
}Possible status codes: