YouTube Comment API
The YouTube Comment API lets you scrape comments from any YouTube video. Returns comment text, likes, reply counts, author details, and pagination tokens for fetching additional pages. Each successful request costs 5 API credits.
Endpoint:
https://api.scrapingdog.com/youtubeAPI Parameters
π
Scrapingdog Parameters
api_keyRequiredYour personal API key. Available on your dashboard.
Type: String
π¬
Video
vRequiredVideo ID of the YouTube video whose comments you want to scrape. Found in the video URL after?v=.
Type: String
π
Geographic Location and Localization
countryOptionalTwo-letter country code specifying search location (e.g.,us,uk,fr). Default:us
Type: StringlanguageOptionalLanguage of the results. Possible Values βen,es,fr,de, etc. Default:en
Type: String
π
Pagination
next_page_tokenOptionalThe parameter defines the next page token for retrieving the next page of comments or replies. Use thenext_page_tokenvalue from the previous response.
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", "country": "us", "language": "en" } response = requests.get("https://api.scrapingdog.com/youtube", params=params) data = response.json() for comment in data["comments"]: print(comment["text"], "-", comment["likes"])
const params = new URLSearchParams({ api_key: "APIKEY", v: "0e3GPea1Tyg", country: "us", language: "en" }); const res = await fetch(`https://api.scrapingdog.com/youtube?${params}`); const data = await res.json(); console.log(`Total comments: ${data.total_comments}`);
<?php $url = 'https://api.scrapingdog.com/youtube?' . http_build_query([ 'api_key' => 'APIKEY', 'v' => '0e3GPea1Tyg', 'country' => 'us', 'language' => 'en', ]); echo file_get_contents($url);
API Response
{
"total_comments": 1883,
"comments": [
{
"comment_id": "Ugx56MInixKwhy9HpRt4AaABAg",
"link": "https://www.youtube.com/watch?v=tj7Sd7fs6JQ&lc=Ugx56MInixKwhy9HpRt4AaABAg",
"channel": {
"id": "UCc6OUZOla4qMvYKGjqahb2A",
"handle": "@matthewp1682",
"link": "https://www.youtube.com/@matthewp1682",
"thumbnail": "https://yt3.ggpht.com/ytc/AIdro_k0PVo4Ayjzf9FlRcdjZA..."
},
"published_date": "1 month ago",
"text": "I have a 2015 model s with the original battery and dual motors with 287k miles. Nothing really has ever broke and it has been amazing the whole time",
"likes": "234",
"replies": "16",
"replies_next_page_token": "Eg0SC3RqN1NkN2ZzNkpRGAYy..."
},
{
"comment_id": "UgyjySf56LStJfgyjz94AaABAg",
"link": "https://www.youtube.com/watch?v=tj7Sd7fs6JQ&lc=UgyjySf56LStJfgyjz94AaABAg",
"channel": {
"id": "UCMsJq6M10YcLaHPMm3U1sBw",
"handle": "@Manufacturergr",
"link": "https://www.youtube.com/@Manufacturergr",
"thumbnail": "https://yt3.ggpht.com/NFv6zJ1-O2mKjUJmef..."
},
"published_date": "1 month ago",
"text": "S and then X was the vehicles that changed automotive industry.",
"likes": "292",
"replies": "9",
"replies_next_page_token": "Eg0SC3RqN1NkN2ZzNkpRGAYy..."
},
{
"comment_id": "UgycL9ktl7Jl4E4x1S14AaABAg",
"link": "https://www.youtube.com/watch?v=tj7Sd7fs6JQ&lc=UgycL9ktl7Jl4E4x1S14AaABAg",
"channel": {
"id": "UCpjK8Q9bu7Iwe4QHYvoLUtQ",
"handle": "@Majortrader8",
"link": "https://www.youtube.com/@Majortrader8",
"thumbnail": "https://yt3.ggpht.com/74iOdZU6EC_AExlfTIbmcK..."
},
"published_date": "1 month ago",
"text": "The EVs that changed everything β‘",
"likes": "319",
"replies": "5",
"replies_next_page_token": "Eg0SC3RqN1NkN2ZzNkpRGAYy..."
}
],
"pagination": {
"next_page_token": "Eg0SC3RqN1NkN2ZzNkpRGAYy6AIKvgJnZXRfcmFua2VkX3N0cmVhbXMt..."
}
}