YouTube Scraper API
Extract video metadata, channel statistics, view counts, comments, playlist data, and trending content from YouTube. Full rendering for dynamic content and infinite scroll. Built on spider-browser .
YouTube is the world's second-largest search engine and the primary platform for video content intelligence. Spider renders YouTube's complex React interface and extracts structured data from videos, channels, playlists, and search results.
- target
- youtube.com
- capability
- Full SPA rendering
- data types
- Videos & channels
Extract data in minutes.
import { SpiderBrowser } from "spider-browser";
const spider = new SpiderBrowser({
apiKey: process.env.SPIDER_API_KEY!,
});
await spider.connect();
const page = spider.page!;
await page.goto("https://www.youtube.com/watch?v=XqZsoesa55w");
await page.content(10000);
const data = await page.evaluate(`(() => {
const ld = [...document.querySelectorAll('script[type="application/ld+json"]')]
.map(s => { try { return JSON.parse(s.textContent); } catch { return null; } })
.flat()
.find(o => o && o["@type"] === "VideoObject");
const title = ld?.name
|| document.querySelector('meta[name="title"]')?.content
|| document.title.replace(/ - YouTube$/, "");
const authorRaw = ld?.author;
const channel = (typeof authorRaw === "string" ? authorRaw : authorRaw?.name)
|| document.querySelector('[itemprop="author"] [itemprop="name"]')?.textContent?.trim()
|| document.querySelector('link[itemprop="name"]')?.getAttribute("content")
|| document.querySelector('a[href*="/channel/"], a[href*="/@"]')?.textContent?.trim();
const description = ld?.description
|| document.querySelector('meta[name="description"]')?.content;
const uploadDate = ld?.uploadDate
|| document.querySelector('[itemprop="uploadDate"]')?.getAttribute("content")
|| document.querySelector('meta[name="datePublished"]')?.content;
const views = ld?.interactionStatistic?.userInteractionCount
|| document.querySelector('[itemprop="interactionCount"]')?.getAttribute("content");
const url = document.querySelector('link[rel="canonical"]')?.href;
return JSON.stringify({ title, channel, description, uploadDate, views, url });
})()`);
console.log(JSON.parse(data));
await spider.close(); Start extracting youtube.com data in three steps.
Get an API key
Sign up free and a balance is credited to your account.
Configure the call
Set the target URL, output format, and rendering mode.
Get structured data
Clean JSON back in seconds, ready for your pipeline.
One endpoint for youtube.com.
Structured JSON from youtube.com with a single POST. AI-resolved selectors, cached on the first call.
/fetch/youtube.com/ curl -X POST https://api.spider.cloud/fetch/youtube.com/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"return_format": "json"}' import requests
resp = requests.post(
"https://api.spider.cloud/fetch/youtube.com/",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={"return_format": "json"},
)
print(resp.json()) const resp = await fetch("https://api.spider.cloud/fetch/youtube.com/", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
body: JSON.stringify({ return_format: "json" }),
});
const data = await resp.json();
console.log(data); What teams build with youtube.com data.
Content Research
Analyze top-performing video titles, descriptions, and tags to optimize your own YouTube content strategy.
Influencer Analytics
Track channel growth, upload frequency, view-to-subscriber ratios, and engagement trends for creator partnerships.
Competitor Monitoring
Monitor competitor channels for new uploads, view velocity, and audience engagement patterns.
Trend Detection
Track trending videos, rising channels, and popular topics across categories and regions.
Fields you can pull.
Full SPA rendering
Complete rendering of YouTube's React interface — handles lazy-loaded comments, recommendations, and infinite scroll.
Channel-level scraping
Process entire channels, playlists, and search results with automatic pagination and scroll.
Rich video metadata
Structured JSON with video stats, channel info, comments, transcripts, and engagement metrics.
Why teams pick Spider for youtube.com.
Free balance on sign-up. No credit card required to test.
About $0.08 per 1,000 pages on a datacenter-proxy workload. No monthly minimum.
Top up once, use it whenever. Unused balance carries over forever.
Scraping youtube.com.
Can I scrape YouTube comments?
Yes. Spider renders the full video page and scrolls the comment section to extract comment text, authors, likes, timestamps, and reply threads.
Does Spider extract YouTube video transcripts?
Spider can access auto-generated and manually uploaded captions/transcripts when available on public videos.
What YouTube data can I extract?
Video titles, descriptions, view counts, likes, upload dates, durations, channel names, subscriber counts, comments, and playlist data.
Can I scrape YouTube search results?
Yes. Spider renders YouTube search pages and extracts video results, channels, and playlists for any search query.
How does Spider handle YouTube infinite scroll?
Spider programmatically scrolls the page in a real Chrome browser, waiting for new content to load before extracting results.
More Media scrapers.
Twitch Scraper
Extract live stream data, channel info, viewer counts, and game categories from Twitch.
Spotify Scraper
Extract playlist data, track listings, artist info, and album metadata from Spotify.
IMDb Scraper
Extract movie ratings, cast info, box office data, and reviews from IMDb.
Start scraping youtube.com.
Grab an API key and call the endpoint above. The first request resolves the config; every request after hits cache.