Platform APIs
YouTube API
Video metadata, channel inventories, transcripts and comment threads with one request shape.
GET /youtube/transcript?url=...2 credits per transcriptauth: x-api-keycontent-type: application/jsonenvelope: data + meta
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| url | string | yes | Public YouTube watch URL or video id. |
| lang | string | no | Caption language, for example en. Defaults to the first track. |
| timestamps | boolean | no | Return timed caption segments instead of plain text. |
request.sh
curl -s "https://api.cleanfetch.dev/v1/youtube/transcript?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ" \ -H "x-api-key: cf_live_your_key_here"
response.json
200 OK / application/json
{
"data": {
"platform": "youtube",
"video": {
"id": "dQw4w9WgXcQ",
"title": "Example video",
"channel": "Example Channel",
"duration": 213,
"views": 1400000000,
"publishedAt": "2009-10-25",
"transcript": [
{ "start": 0.0, "end": 2.4, "text": "We are no strangers to love." }
]
}
},
"meta": {
"requestId": "req_cf_01j9k977b7c",
"lookupStatus": "found",
"creditsCharged": 2,
"latencyMs": 1310,
"cached": false
}
}Endpoints
Use /v1/youtube/transcript, /v1/youtube/video, /v1/youtube/channel and /v1/youtube/comments. The directory lists 24 YouTube endpoints.
Credits
A transcript costs 2 credits and the free tier allows 5 a day. A video with captions disabled returns not_found and costs 2 credits; an upstream failure costs none and a cache hit costs zero.
Caption scope
Only public caption tracks are read. Auto-generated captions are returned when the platform exposes them. The response labels the track language and whether it was auto-generated.