Scrape YouTube with a JSON API. This repo has working Python examples for DataGuru's YouTube scraper APIs: YouTube Channel Details, YouTube Video Comments and YouTube Video Details.
DataGuru runs the scraping, proxies, retries and parsing, and returns clean JSON. You pay only for successful requests, from $0.0012 per request, out of a prepaid balance: no subscription. New accounts get $1.00 of free credit.
| API | What it returns | Price | Page |
|---|---|---|---|
| YouTube Channel Details | Scrape YouTube channel metadata, subscriber count, total video count, description, and links. | $0.0022 | https://dataguru.cc/apis/youtube-channel/ |
| YouTube Video Comments | Extract top comments, author usernames, upvote counts, and replies from a YouTube video. | $0.0012 | https://dataguru.cc/apis/youtube-comments/ |
| YouTube Video Details | Extract YouTube video details, views, likes, publication date, description, and tags. | $0.0022 | https://dataguru.cc/apis/youtube-video/ |
- Create a free account and an API key at dashboard.dataguru.cc.
- Install and run:
git clone https://github.com/dataguru-cc/youtube-scraper-api.git
cd youtube-scraper-api
pip install -r requirements.txt
export DATAGURU_API_KEY="your key"
python examples/sdk_example.py youtube-channelEvery example covers all 3 YouTube APIs. Pass an API name to run just one; with no name each script runs them all, and each call is billed at the price above.
| File | Style | Run |
|---|---|---|
examples/sdk_example.py |
DataGuru Python SDK (pip install dataguru-sdk), one function per API, saves JSON to output/ |
python examples/sdk_example.py |
examples/requests_example.py |
Plain requests, synchronous |
python examples/requests_example.py |
examples/async_example.py |
asyncio + httpx, concurrent with a limit |
python examples/async_example.py |
examples/scrapy_spider.py |
Scrapy spider, items to JSON/CSV | scrapy runspider examples/scrapy_spider.py -O youtube.json |
All requests use the header Authorization: Api-Key YOUR_API_KEY. Errors return {"success": false, "error": {"code", "message", "request_id"}}, with HTTP 402 when the balance runs out and 429 (with Retry-After) when rate limited. Failed requests are not charged.
Scrape YouTube channel metadata, subscriber count, total video count, description, and links.
- Endpoint:
POST https://api.dataguru.cc/api/v1/youtube/channel - Price: $0.0022 per successful request ($2.20 per 1,000)
- Rate limit: 60 requests/minute
- Page and live playground: https://dataguru.cc/apis/youtube-channel/
- Documentation: https://dataguru.cc/documentation/youtube-channel/
| Parameter | Type | Required | Description |
|---|---|---|---|
target |
string | yes | YouTube channel URL or @handle |
Response fields: about, channel, highlighted_video, videos_sections, shorts_sections, plus _metadata
curl -X POST "https://api.dataguru.cc/api/v1/youtube/channel" \
-H "Authorization: Api-Key $DATAGURU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"target": "@MrBeast"}'Response schema
Values are type placeholders from the API's published schema, not real data.
{
"about": {
"description": "string",
"subscribers": "string",
"subscribers_extracted": 0,
"videos": "string",
"views": "string",
"joined_date_text": "string",
"joined_date": "2026-01-01T12:00:00Z",
"links": [
"string"
]
},
"channel": {
"handle": "string",
"id": "1234567890",
"title": "string",
"subscribers": "string",
"videos": "string",
"description": "string",
"keywords": "string",
"available_countries": [
"string"
],
"tags": [
"string"
],
"facebook_profile_id": "1234567890",
"first_link": "https://example.com/...",
"is_family_safe": false,
"avatar": "string",
"banner": "string"
},
"highlighted_video": {
"id": "1234567890",
"title": "string",
"link": "https://example.com/...",
"description": "string",
"external_links": [
"string"
],
"views": "string",
"published_time": "string"
},
"videos_sections": [
{
"section_title": "string",
"videos": [
"string"
]
}
],
"shorts_sections": [
{
"section_title": "string",
"videos": [
"string"
]
}
],
"_metadata": {
"request_id": "3f6c1a2e-8b4d-4c1e-9a7f-2d5e6b7c8d9e",
"execution_time_ms": 842,
"endpoint": "YouTube Channel Details",
"mode": "live",
"format": "json",
"timestamp": "2026-01-01T12:00:00+00:00"
}
}Extract top comments, author usernames, upvote counts, and replies from a YouTube video.
- Endpoint:
POST https://api.dataguru.cc/api/v1/youtube/comments - Price: $0.0012 per successful request ($1.20 per 1,000)
- Rate limit: 60 requests/minute
- Page and live playground: https://dataguru.cc/apis/youtube-comments/
- Documentation: https://dataguru.cc/documentation/youtube-comments/
| Parameter | Type | Required | Description |
|---|---|---|---|
limit |
integer | no | Number of comments to return Default: 20. |
video_url |
string | yes | YouTube video URL |
Response fields: comment_id, link, channel, published_date, text, likes, replies, replies_next_page_token, plus _metadata
curl -X POST "https://api.dataguru.cc/api/v1/youtube/comments" \
-H "Authorization: Api-Key $DATAGURU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "limit": 10}'Response schema
Values are type placeholders from the API's published schema, not real data.
{
"comments": [
{
"comment_id": "1234567890",
"link": "https://example.com/...",
"channel": {
"id": "1234567890",
"handle": "string",
"link": "https://example.com/...",
"thumbnail": "string"
},
"published_date": "2026-01-01T12:00:00Z",
"text": "string",
"likes": "string",
"replies": "string",
"replies_next_page_token": "string"
}
],
"_metadata": {
"request_id": "3f6c1a2e-8b4d-4c1e-9a7f-2d5e6b7c8d9e",
"execution_time_ms": 842,
"endpoint": "YouTube Video Comments",
"mode": "live",
"format": "json",
"timestamp": "2026-01-01T12:00:00+00:00"
}
}Extract YouTube video details, views, likes, publication date, description, and tags.
- Endpoint:
POST https://api.dataguru.cc/api/v1/youtube/video - Price: $0.0022 per successful request ($2.20 per 1,000)
- Rate limit: 60 requests/minute
- Page and live playground: https://dataguru.cc/apis/youtube-video/
- Documentation: https://dataguru.cc/documentation/youtube-video/
| Parameter | Type | Required | Description |
|---|---|---|---|
target |
string | yes | YouTube video URL or video ID |
Response fields: video_id, title, description, channel_id, channel_title, publish_date, category, duration_seconds, high_res_thumbnail_urls, tags_keywords, view_count, like_count, comment_count, plus _metadata
curl -X POST "https://api.dataguru.cc/api/v1/youtube/video" \
-H "Authorization: Api-Key $DATAGURU_API_KEY" \
-H "Content-Type: application/json" \
-d '{"target": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'Response schema
Values are type placeholders from the API's published schema, not real data.
{
"video_metadata": {
"video_id": "1234567890",
"title": "string",
"description": "string",
"channel_id": "1234567890",
"channel_title": "string",
"publish_date": "2026-01-01T12:00:00Z",
"category": "string",
"duration_seconds": 0,
"high_res_thumbnail_urls": [
"https://example.com/..."
],
"tags_keywords": [
"string"
],
"view_count": 0,
"like_count": 0,
"comment_count": 0
},
"_metadata": {
"request_id": "3f6c1a2e-8b4d-4c1e-9a7f-2d5e6b7c8d9e",
"execution_time_ms": 842,
"endpoint": "YouTube Video Details",
"mode": "live",
"format": "json",
"timestamp": "2026-01-01T12:00:00+00:00"
}
}- Python SDK and examples for all DataGuru APIs: github.com/dataguru-cc/dataguru-python (docs)
- Every API, with a live playground: https://dataguru.cc/apis/
- Use DataGuru from Claude, ChatGPT or Cursor through the MCP server: https://dataguru.cc/mcp/
- Run thousands of inputs from a CSV at half price with batch jobs: https://dataguru.cc/documentation/
- Other scraper APIs: 1688, Airbnb, Alibaba, AliExpress, Amazon, arXiv, ASOS, Best Buy, Booking.com, Brave Search, CA State Bar, Capterra, CoinGecko, CoinMarketCap, Companies House, Costco, CourtListener, Crunchbase, Discord, DoorDash, eBay, Etsy, Expedia, Fiverr, Flipkart, Glassdoor, Google Flights, Google Patents, Google Scholar, Google Search, Grubhub, Home Depot, Instagram, Investing.com, Justia, Kayak, Kick, Lazada, MarketWatch, Mercado Libre, Monster, OpenCorporates, OpenTable, PACER, PitchBook, PubMed, Reddit, Redfin, Resy, Rightmove, SEC EDGAR, Seeking Alpha, Shopee, Skyscanner, Target, TikTok, TradingView, TripAdvisor, Trulia, TrustRadius, Twitch, Uber Eats, Upwork, Vrbo, Walmart, Wayfair, X (Twitter), Yahoo Finance, Zillow, ZoomInfo, Zoopla
The example code is MIT licensed. Use of the DataGuru API is subject to the terms of service.