YouTube transcript API
Pull existing YouTube captions as full plainText plus millisecond-timed segments — watch links, youtu.be, and Shorts in one Social Fetch envelope.
GET /v1/youtube/videos/transcript1 credit per successful request.
About this endpoint
Long-form and Shorts pipelines need caption text for embedding, citation, and chapter UIs. YouTube's on-page caption panel is fine for a human. Batch jobs need a stable JSON shape: the full string when you embed, and `startMs` / `endMs` when you seek a player to a quoted line.
`GET /v1/youtube/videos/transcript` accepts a public video `url` (watch, `youtu.be`, Shorts). On a found lookup, `data.transcript` includes `plainText`, `language` (when reported), and `segments` (`text`, `startMs`, `endMs`). `data.video` carries the resolved id and URL. Pass optional `language` as a two-letter ISO 639-1 code when multiple caption tracks exist and you prefer one. Branch on `data.lookupStatus` (`found` / `not_found` / `lookup_failed`) before you write rows — HTTP 200 alone does not mean text arrived.
This route reads existing captions. It does not run speech-to-text when no track exists, and there is no `useAiFallback` query (unlike TikTok). A completed `not_found` means no usable track for that URL. Pricing is on the credit badge; bill from `meta.creditsCharged`. For channel metadata or upload lists, use the channel and channels/videos routes under the same YouTube tag.
YouTube transcript API FAQ
How do I get a YouTube video transcript via API?
Call `GET /v1/youtube/videos/transcript` with your Social Fetch API key (`x-api-key`) and a public video `url`. Read `data.lookupStatus`, then `data.transcript.plainText` or `data.transcript.segments`. Full parameters and examples are in the API docs.
How much does the YouTube transcript endpoint cost?
Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged — that field is the billing source of truth.
What does the YouTube transcript response look like?
When found, `data.transcript` includes `plainText` (full string), `language` when reported, and `segments` (`text`, `startMs`, `endMs`). `data.video` carries the resolved video id and URL. Always branch on `data.lookupStatus` before treating the transcript as present.
Can I prefer a language for YouTube captions?
Yes. Pass optional `language` as a two-letter ISO 639-1 code (for example `en`). Social Fetch prefers that track when it exists. There is no guarantee the creator uploaded captions in that language.
What URL formats does the YouTube transcript API accept?
Public YouTube video URLs: standard watch links, `youtu.be` short links, and Shorts URLs. Pass one `url` per request.
Does this run speech-to-text when YouTube has no captions?
No. This route returns caption tracks when they exist. There is no `useAiFallback` path. If captions are missing, expect `not_found` (or a null transcript) rather than generated speech.
Does a completed YouTube transcript lookup always return text?
No. `data.lookupStatus` of `not_found` means the lookup finished and no transcript was available. You still pay for a completed successful request when the operation documents that charge. Persist `meta.requestId` when you need to debug a miss.
Other YouTube endpoints
- ChannelGET /v1/youtube/channel
- Channel videosGET /v1/youtube/channels/videos
- Channel shortsGET /v1/youtube/channels/shorts
- PlaylistGET /v1/youtube/playlists
- Community postGET /v1/youtube/community-posts
- SearchGET /v1/youtube/search
- Hashtag searchGET /v1/youtube/search/hashtags
- Trending shortsGET /v1/youtube/shorts/trending