Skip to main content
NEW AI Studio is now available Try it now
Media Verified

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. Powered by 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.

Get Started Documentation Free tier — no credit card
youtube.com target
Full SPA rendering capability
Videos & channels data types
Quick Start

Extract data in minutes

youtube-scraper.ts
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();
✓ ready to run | spider-browser | TypeScript
How It Works

Start extracting youtube.com data in 3 steps

01

Get your API key

Sign up for free and get 1,000 credits instantly.

02

Configure your scrape

Set your target URL, output format, and stealth level.

03

Extract structured data

Get clean JSON back in seconds — ready for your pipeline.

Fetch API

Structured data endpoint

Extract structured JSON from youtube.com with a single POST request. AI-configured selectors, cached for fast repeat calls.

POST /fetch/youtube.com/
Video titleChannel nameView countLike countUpload dateDescription
curl
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"}'
Python
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())
Node.js
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);
Use Cases

What people 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.

Start extracting youtube.com data today

1,000 free credits — no credit card required

Extraction

Data you can extract

Video titleChannel nameView countLike countUpload dateDescriptionDurationComments
Rendering

Full SPA rendering

Complete rendering of YouTube's React interface — handles lazy-loaded comments, recommendations, and infinite scroll.

Scale

Channel-level scraping

Process entire channels, playlists, and search results with automatic pagination and scroll.

Data

Rich video metadata

Structured JSON with video stats, channel info, comments, transcripts, and engagement metrics.

Why Spider

Why teams choose Spider for youtube.com

$0 to start

Free tier with 1,000 credits. No credit card required to get started.

No rate limits

Scale to millions of pages. Pay only for what you use.

Credits never expire

Unlike competitors, unused credits roll over indefinitely.

FAQ

Common questions about 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.

Related

More Media scrapers

Join Zapier, Swiss Re, and 10,000+ developers

Start scraping youtube.com

Get your API key and start extracting data in minutes.