YouTube Transcripts API
The YouTube Transcripts API lets you extract the complete transcript (captions) from any YouTube video. Returns an array of text segments with start time and duration. Each successful request costs 1 API credit.
Endpoint:
https://api.scrapingdog.com/youtubeAPI Parameters
π
Scrapingdog Parameters
api_keyRequiredYour personal API key. Available on your dashboard.
Type: String
π¬
Video
vRequiredYouTube Video ID. You can find it in the video URL after?v=(e.g., foryoutube.com/watch?v=0e3GPea1Tyg, the ID is0e3GPea1Tyg).
Type: String
π
Localization
countryOptionalISO code of the country from which you are seeking YouTube search results. Default:us
Type: StringlanguageOptionalLanguage of the results. Possible Values βen,es,fr,de, etc. Default:en
Type: String
API Examples
Code to Integrate
curl "https://api.scrapingdog.com/youtube?api_key=APIKEY&v=0e3GPea1Tyg"
import requests params = { "api_key": "APIKEY", "v": "0e3GPea1Tyg", "language": "en" } response = requests.get("https://api.scrapingdog.com/youtube", params=params) print(response.json())
const params = new URLSearchParams({ api_key: "APIKEY", v: "0e3GPea1Tyg", language: "en" }); const res = await fetch(`https://api.scrapingdog.com/youtube?${params}`); const data = await res.json(); console.log(data.transcripts);
<?php $url = 'https://api.scrapingdog.com/youtube?' . http_build_query([ 'api_key' => 'APIKEY', 'v' => '0e3GPea1Tyg', 'language' => 'en', ]); echo file_get_contents($url);
API Response
{
"transcripts": [
{
"text": "- [Mr. Beast] I've\nrecreated every single set",
"start": 0.15,
"duration": 1.773
},
{
"text": "from Squid Game in real life,",
"start": 1.923,
"duration": 1.857
},
{
"text": "and actually played the games.",
"start": 3.78,
"duration": 1.89
}
]
}