Documentation has been updated: see help center and changelog in one place.

YouTube Transcript

Learn how to scrape transcripts from YouTube videos using Web Scraper API. Find out more about its parameters and practical examples.

You can get YouTube video transcripts by providing a YouTube video ID and a language_code to the youtube_transcript source.

Request samples

The following examples demonstrate how to retrieve the English transcript of a YouTube video, specifically when the transcript was provided by the uploader.

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "youtube_transcript",
        "query": "SLoqvcnwwN4",
        "context": [
            {
                "key": "language_code",
                "value": "en"
            },
            {
                "key": "transcript_origin",
                "value": "uploader_provided"
            }
        ]
    }'

We use synchronous Realtime integration method in our examples. If you would like to use Proxy Endpoint, or asynchronous Push-Pull integration, refer to the Integration Methods section.

Request parameter values

Generic

Parameter
Description
Default Value

source

Sets the scraper.

youtube_transcript

query

YouTube video ID.

-

context: language_code

Specifies the language of the transcript. Find available values here. NOTE: If the provided language_code has no matching transcript in the YouTube video, the result returns a 404 status.

-

context: transcript_origin (optional)

Specifies whether to retrieve transcripts that are auto_generated or uploader_provided.

auto_generated

callback_url

URL to your callback endpoint. More info.

-

- mandatory parameter

Last updated

Was this helpful?