Extract YouTube transcript
Returns the transcript as timestamped segments and joined plain text. A preferred language code may be supplied; otherwise YouTube's first available caption track is used.
/transcript Transcript https://api.fetchlayer.dev/youtube/transcript Headers
Authorization string required Bearer token — your FetchLayer API key.
Parameters
videoUrl string required Full YouTube video URL.
language string optional Preferred transcript language code, such as en or en-US. Defaults to YouTube's first available caption track.
Response Fields
transcript
Extract YouTube transcript
segments object[] Array of timestamped transcript segments.
segments[].start number Start time in seconds.
segments[].duration number Duration in seconds.
segments[].text string Transcript text for this segment.
text string Full transcript as joined plain text.
Request
curl -X POST "https://api.fetchlayer.dev/youtube/transcript" \
-H "Authorization: Bearer ss-your-key" \
-H "Content-Type: application/json" \
-d '{"videoUrl":"https://www.youtube.com/watch?v=dQw4w9WgXcQ","language":"en"}'Response
{
"segments": [
{
"start": 0,
"duration": 3.5,
"text": "We're no strangers to love"
}
],
"text": "We're no strangers to love..."
}