YouTube Trending Scraper avatar

YouTube Trending Scraper

Pricing

from $3.00 / 1,000 results

Go to Apify Store
YouTube Trending Scraper

YouTube Trending Scraper

Scrape trending and popular YouTube videos by category. Returns ranked video lists for Gaming, News, Music, Movies, and more.

Pricing

from $3.00 / 1,000 results

Rating

0.0

(0)

Developer

Crawler Bros

Crawler Bros

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 hours ago

Last modified

Share

Scrape trending and popular YouTube videos by category — Gaming, News, Music, Movies, and the main Trending feed. Returns ranked video lists with titles, channels, view counts, durations, thumbnails, and badge metadata.

What You Get

Each scraped video includes:

FieldDescriptionExample
positionRank in the trending list1
videoIdYouTube video ID"dQw4w9WgXcQ"
titleVideo title"Minecraft 1.21 Update"
channelNameChannel display name"Dream"
channelUrlFull channel URL"https://www.youtube.com/@Dream"
viewCountTextHuman-readable view count"3.2M views"
publishedTimeTextRelative publish time"2 days ago"
durationTextVideo duration"12:34"
thumbnailUrlHighest-resolution thumbnail URL"https://i.ytimg.com/vi/..."
badgesArray of badge labels["4K", "CC"]
isLiveWhether the video is a live streamtrue
categoryInput category used"gaming"
scrapedAtISO 8601 UTC timestamp"2024-01-15T10:30:00+00:00"

Fields with no value are omitted from output rather than being returned as null.

Input

FieldTypeDefaultDescription
categorystring"gaming"Trending section: now, gaming, music, movies, news
maxResultsinteger50Maximum number of videos to return (1–200)
marketstring"US"Regional market: US, GB, DE, IN, JP, BR, FR, ES, KR, RU

Category Notes

  • gaming — YouTube Gaming trending feed. Works without authentication and typically surfaces dozens to hundreds of videos across shelf sections. Most reliable category.
  • news — Redirects to the YouTube News channel and returns recent top-story videos grouped by shelf. Works without authentication. Typically surfaces 100–200 videos.
  • music — YouTube Music channel. Returns music videos from trending playlists and charts. Works without authentication; surfaces 30–80 individual videos.
  • movies — YouTube Movies channel. Requires YouTube authentication; unauthenticated access only shows a promotional page with no video data.
  • now — Main YouTube Trending feed (/feed/trending). Requires YouTube authentication; unauthenticated requests redirect to the home page and return no results.

Example Input

{
"category": "gaming",
"maxResults": 50,
"market": "US"
}

How It Works

The scraper uses Playwright (headless Chromium) to render YouTube's JavaScript-heavy trending pages and extract the embedded ytInitialData JSON object, which contains the full structured video data. HTTP-only fetches return 0 videos because trending pages require JS execution.

The scraper:

  1. Launches a headless Chromium browser with consent cookies pre-set to bypass GDPR overlays
  2. Navigates to the category URL with region parameters (?gl=US&hl=en)
  3. Waits for JS to execute and populate window.ytInitialData
  4. Parses shelf sections (shelfRenderer, gridVideoRenderer, videoRenderer, richGridRenderer) to extract all visible videos
  5. Trims to maxResults and pushes to the dataset

Frequently Asked Questions

Why does the now or movies category return no results? YouTube's main trending feed (/feed/trending) and the Movies channel both require authentication. Unauthenticated users are silently redirected or shown only a promotional page with no video data. Use gaming, news, or music for reliable unauthenticated scraping.

How many videos can I get? The Gaming category surfaces the most videos (200–400 across shelf sections). Music, Movies, and News categories depend on what YouTube populates on those channel pages, typically 30–100 videos. Set maxResults up to 200 to capture as many as possible.

Does this work without a proxy? Yes. The scraper is designed to work without a proxy and actually tries without proxy first, as proxy IPs can trigger GDPR consent pages or regional redirects. A proxy is configured as a fallback if the initial no-proxy attempt fails.

What regions are supported? US, GB, DE, IN, JP, BR, FR, ES, KR, RU. The market field sets the gl (geolocation) and hl (language) parameters to return region-specific trending content.

Are live streams included? Yes. Live streams appear in trending feeds and are flagged with "isLive": true and a "LIVE" badge in the badges array.

Why are some fields missing from certain videos? Fields like publishedTimeText and durationText are not available for live streams (they have no fixed duration or publish date yet). Fields with no value are omitted entirely from the output record to keep the data clean.

Output Dataset Views

The dataset offers two views in the Apify UI:

  • Trending Overview — Compact view: position, videoId, title, channelName, viewCountText, isLive, category
  • Full Details — All fields including channelUrl, durationText, thumbnailUrl, badges, and scrapedAt timestamp

Use Cases

  • Daily trend monitoring — schedule the actor to run every morning and track which topics dominate the Gaming or Music trending feed
  • Content strategy — identify which video formats, lengths, and titles are trending right now in your niche
  • Competitive intelligence — see which channels are appearing in trending feeds across different categories
  • Market research — compare trending content across different regional markets using the market parameter
  • News tracking — use the news category to capture the day's top-story videos without a news API subscription
  • SEO and keyword research — extract trending video titles to identify high-traffic keywords and phrases

FAQ

Which categories are most reliable? gaming, news, and music are the most reliable for unauthenticated scraping. now (main trending feed) and movies require YouTube authentication and return no results without it.

How often does trending content change? The Gaming and Music trending lists refresh frequently throughout the day. For accurate trend snapshots, schedule runs every 1–6 hours.

Can I scrape trending content for non-US markets? Yes. Set the market field to any supported country code (e.g. GB, DE, JP, BR). Results will reflect the trending content for that region.

Do I need a proxy? No. The actor is designed to work without a proxy and tries direct connections first. Proxy fallback is used automatically when direct access is blocked.

Why does maxResults sometimes return fewer videos than configured? YouTube's category pages have a fixed number of available trending slots. If a category has fewer videos than your maxResults limit, you will get all available videos.

YouTube Scraper Suite

This actor is part of a complete YouTube data extraction toolkit. Explore the full suite:

ActorDescription
YouTube Channel ScraperChannel metadata, subscriber counts, and full video catalogs
YouTube Channel Scraper FastStreamlined channel scraper for high-volume and speed-sensitive workflows
YouTube Comment ScraperComments, replies, likes, author info, and pinned/hearted status
YouTube Email ScraperCreator contact emails from channel pages, Instagram, TikTok, and Linktree
YouTube Hashtag ScraperVideos and Shorts tagged with specific hashtags
YouTube Playlist ScraperAll videos and metadata from any YouTube playlist
YouTube Search ScraperSearch results including videos, channels, and playlists
YouTube Shorts ScraperShorts from channels or hashtags with full view and like metadata
YouTube Transcript ScraperTimed transcripts and captions with optional Whisper AI fallback
YouTube Trending ScraperRanked trending videos by category — Gaming, Music, News, Movies
YouTube Video Details ScraperComprehensive video metadata, chapters, endscreen, captions, and comments
YouTube Video DownloaderDownload videos, playlists, and channels in any quality with metadata