DEV Community

Cover image for How to Scrape YouTube Data Without the Official API (No Quota Limits)
Алексей Спинов
Алексей Спинов

Posted on

How to Scrape YouTube Data Without the Official API (No Quota Limits)

The YouTube Data API has strict quota limits — 10,000 units per day, and a single search costs 100 units. That gives you only 100 searches per day.

Here is how to get YouTube data without those limits, using the internal Innertube API and direct page parsing.

4 YouTube Data Tools

1. YouTube Comments Scraper

The official API charges 1 unit per comment. With 10,000 daily units, you can only get 10,000 comments per day.

The Innertube API has no such limits. Here is the approach:

// Fetch the video page
const html = await fetch(`https://www.youtube.com/watch?v=${videoId}`).then(r => r.text());

// Extract the continuation token from ytInitialData
const ytData = JSON.parse(html.match(/ytInitialData\s*=\s*({.*?});/)[1]);

// Navigate to comments section
const contents = ytData.contents.twoColumnWatchNextResults
  .results.results.contents;

// Find the comment section continuation
const commentSection = contents.find(c => c.itemSectionRenderer?.targetId === "comments-section");
Enter fullscreen mode Exit fullscreen mode

The scraper handles pagination automatically, extracting all comments with:

  • Author name and channel
  • Comment text
  • Like count
  • Reply count
  • Published date
  • Whether the author is verified

2. YouTube Channel Scraper

Get complete channel data without API:

  • Subscriber count
  • Total videos
  • Channel description and links
  • Recent video list with view counts
  • Channel creation date

3. YouTube Search Scraper

Search YouTube and get structured results:

  • Video title, URL, thumbnail
  • View count and publish date
  • Channel name
  • Duration
  • Description snippet

4. YouTube Transcript Scraper

Extract video captions and subtitles:

  • Supports multiple languages
  • Includes timestamps
  • Works with auto-generated captions
  • Handles YouTube Shorts
// Get caption tracks from player response
const captionMatch = html.match(/"captionTracks":\[(.+?)\]/);
const tracks = JSON.parse(`[${captionMatch[1]}]`);

// Fetch the transcript XML
const transcript = await fetch(track.baseUrl).then(r => r.text());
Enter fullscreen mode Exit fullscreen mode

Use Cases

  • Content research — analyze what topics get the most views
  • Sentiment analysis — process comments at scale
  • Competitor monitoring — track competitor channel growth
  • AI training data — build datasets from video transcripts
  • Marketing analytics — measure engagement across channels

Try Them Free

All 4 tools are on the Apify Store. Source code and docs on GitHub.


Also: 60+ web scraping tools, 15 MCP servers for AI agents, free market research reports.

Top comments (0)