All guides

How to scrape YouTube Video

Scrape YouTube videos from searches, channels, playlists, hashtags or URLs: views, likes, comment count, exact date, duration, description, tags, chapters, subtitle languages and channel stats. YouTube search filters. No login, no API key, no quota. $2 per 1,000 videos.

Open YouTube Video Scraper: Search, Channels, Playlists, $2/1K on Apify

YouTube video scraper for search terms, channels, playlists, hashtags or video URLs, no login and no API quota: one row per video with title, views, likes, comment count, exact publish date, duration, description, tags, chapters, subtitle languages and the channel's subscriber count.

This Actor vs streamers/youtube-scraper: that one is the most-used YouTube scraper. Choose this one for chapters, subtitle languages, tags and hashtags in flat rows, the same filters as YouTube search (upload date, length, HD, 4K, subtitles, Creative Commons), and a monitor mode that returns only new videos.

What it outputs

One row per video. Example (shortened):

Example input

{
  "searchQueries": ["web scraping tutorial"],
  "maxResults": 20
}

Sample output

{
  "id": "XVv6mJpFOb0",
  "url": "https://www.youtube.com/watch?v=XVv6mJpFOb0",
  "title": "Web Scraping with Python - Beautiful Soup Crash Course",
  "type": "video",
  "channelName": "freeCodeCamp.org",
  "channelId": "UC8butISFwT-Wl7EV0hUK0BQ",
  "channelUrl": "https://www.youtube.com/@freecodecamp",
  "channelHandle": "@freecodecamp",
  "numberOfSubscribers": 11900000,
  "channelVerified": true,
  "viewCount": 1826157,
  "likes": 39427,
  "commentsCount": 1100,
  "date": "2020-11-18T08:05:43-08:00",
  "duration": "1:08:23",
  "durationSeconds": 4103,
  "description": "Learn how to perform web scraping with Python using the Beautiful Soup library...",
  "hashtags": [],
  "tags": [],
  "category": "Education",
  "chapters": [{ "title": "Packages Installation", "time": "5:35", "startSeconds": 335 }],
  "subtitleLanguages": [{ "language": "en", "name": "English (auto-generated)", "autoGenerated": true }],
  "isLive": false,
  "isShort": false,
  "fromSource": "search",
  "searchQuery": "web scraping tutorial",
  "position": 1
}

Sample taken from the actor's README; values shown as placeholders there are placeholders.

FAQ

Do I need a YouTube API key or quota?

No. The actor reads the same public pages a logged-out browser sees, so there is no 10,000-unit daily quota.

Do I need a proxy?

No for normal runs. If YouTube starts rate-limiting, the run switches to Apify residential proxy by itself (turn autoProxyFallback off to prevent this).

Can I get comments or transcripts?

This actor lists which subtitle languages each video has. For the comment text and transcript text, use our YouTube comments and transcript actors.

Is scraping YouTube legal?

The actor collects public information only. You are responsible for using the data in line with YouTube's terms, copyright and privacy laws such as GDPR.

Something missing or broken?

Open an issue on the Issues tab with the run URL and we will reply there.

Where do I run it?

On Apify: https://apify.com/transparent_meteorite/youtube-video-scraper. Check the Pricing tab there for current prices.

Try YouTube Video Scraper: Search, Channels, Playlists, $2/1K on Apify