Skip to content

fetchYoutubeTranscript ​

Import from: @xbbg/xnews

fetchYoutubeTranscript(video, options?): Promise<YoutubeTranscript>

Defined in: src/sources/youtubetranscript.ts (declaration: sources/youtubetranscript.d.ts:48)

Fetches a video's transcript through its advertised caption tracks: free and keyless. Accepts a video ID or any YouTube video URL, for example the url of an item returned by fetchYoutubeSubscriptions. Tracks come from the InnerTube player API first (its caption URLs stay readable server-side) with the watch-page player data as fallback. Throws when the video advertises no caption tracks or the caption payload is gated.

Parameters ​

video ​

string

options? ​

YoutubeTranscriptOptions

Returns ​

Promise<YoutubeTranscript>

Last updated:

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.