YouTube Trending Videos Scraper
Pricing
Pay per event
YouTube Trending Videos Scraper
Scrape ranked YouTube Trending videos by country and category with video IDs, titles, channels, views, thumbnails, and source URLs.
Pricing
Pay per event
Rating
0.0
(0)
Developer
Stas Persiianenko
Maintained by CommunityActor stats
0
Bookmarked
3
Total users
2
Monthly active users
3 days ago
Last modified
Categories
Share
Scrape public YouTube trending-style video results by country, category, and result limit.
Use this actor to monitor what videos are gaining attention, build content research dashboards, and export structured YouTube video metadata without maintaining your own parser.
What does YouTube Trending Videos Scraper do?
YouTube Trending Videos Scraper collects ranked video rows for a selected country and category.
It is designed for recurring monitoring jobs where you need a clean dataset instead of manually opening YouTube and copying titles.
The actor returns video IDs, watch URLs, titles, channel names, published-time text, view counts when available, thumbnails, selected category, selected region, and the source URL used for the run.
It first tries the public YouTube Trending page.
If YouTube returns a logged-out shell with no video renderers, the actor can transparently use a public YouTube search fallback for the same trending category.
Each row includes sourceType so you can see whether the result came from the official page or from the fallback.
Who is it for?
Content strategists
Use the actor to spot video topics, formats, and hooks that are currently popular in a target market.
Social media agencies
Run the actor daily for multiple countries and categories, then compare rising topics across clients and regions.
News and market monitors
Track what public YouTube users are likely seeing around news, sports, entertainment, music, and education topics.
Creator teams
Export titles, thumbnails, durations, channels, and view-count text for inspiration boards and editorial calendars.
Data analysts
Feed ranked video metadata into spreadsheets, BI tools, warehouses, or notification workflows.
Why use this actor?
- ๐ฏ Country-aware input using YouTube
glregion codes. - ๐งญ Category presets for general, music, gaming, movies, news, sports, fashion, and learning.
- ๐ฆ Structured JSON dataset ready for export.
- ๐ Direct YouTube watch URLs and video IDs.
- ๐ผ๏ธ Thumbnail URLs for dashboards.
- โฑ๏ธ Duration and published-time text when exposed by YouTube.
- ๐ View-count text plus parsed numeric views when possible.
- ๐งพ Source URL and source type for auditing.
- โ๏ธ HTTP-only implementation for lower run cost.
- ๐งช Conservative default input for cheap first tests.
What data can you extract?
| Field | Description |
|---|---|
rank | Rank within the returned dataset. |
videoId | YouTube video identifier. |
url | Direct https://www.youtube.com/watch?v=... URL. |
title | Video title. |
channelName | Channel name when available. |
channelUrl | Channel URL when available. |
publishedTimeText | Human-readable freshness text, such as 2 days ago. |
viewCountText | Human-readable views text. |
viewCount | Parsed numeric view count when possible. |
durationText | Video duration text. |
thumbnailUrl | Best available thumbnail URL. |
badges | Renderer badges such as verified labels when available. |
category | Category input used for the run. |
region | Country code input used for the run. |
sourceType | Official trending page or fallback search. |
sourceUrl | URL fetched for the returned rows. |
scrapedAt | ISO timestamp for the scrape. |
How much does it cost to scrape YouTube trending videos?
This actor uses pay-per-event pricing.
There is a small start charge per run and a per-video charge for each saved dataset item.
The default input is intentionally small so you can test the actor cheaply before scheduling larger jobs.
For the latest exact price, check the Pricing tab on the Apify Store page.
How to use YouTube Trending Videos Scraper
- Open the actor on Apify.
- Choose a country code, for example
US,GB,DE,IN, orBR. - Pick a category such as
all,music,gaming, ornews. - Set
maxItemsto the number of videos you want. - Keep
fallbackToSearchenabled unless you only want official-page rows. - Start the run.
- Export the dataset as JSON, CSV, Excel, XML, or RSS.
Input options
region
Two-letter country code used by YouTube.
Examples:
USGBDEINBRCAAUJP
category
Supported values:
allmusicgamingmoviesnewssportsfashionlearning
maxItems
Maximum number of videos to save.
Use a small value for test runs.
Use a larger value for scheduled monitoring jobs.
language
YouTube interface language, for example en, de, es, fr, or pt.
fallbackToSearch
YouTube sometimes returns a logged-out page with no public video renderers.
When this option is enabled, the actor uses public YouTube search for a matching trending query and records sourceType: youtube_search_fallback.
Disable it if your workflow requires only official Trending-page rows.
Example input
{"region": "US","category": "all","maxItems": 25,"language": "en","fallbackToSearch": true}
Example output
{"rank": 1,"videoId": "dQw4w9WgXcQ","url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ","title": "Example trending video title","channelName": "Example Channel","channelUrl": "https://www.youtube.com/@example","publishedTimeText": "1 day ago","viewCountText": "1.2M views","viewCount": 1200000,"durationText": "12:34","thumbnailUrl": "https://i.ytimg.com/vi/example/hqdefault.jpg","badges": [],"category": "all","region": "US","sourceType": "youtube_search_fallback","sourceUrl": "https://www.youtube.com/results?...","scrapedAt": "2026-06-13T00:00:00.000Z"}
Tips for best results
- Start with
maxItems: 25to validate your workflow. - Schedule daily or hourly runs for trend monitoring.
- Store
sourceTypein your downstream table so you can filter official-page rows separately. - Compare the same category across multiple regions.
- Use
videoIdas a stable deduplication key. - Keep thumbnails for editorial review boards.
- Use
viewCountfor numeric sorting when YouTube exposes view text.
Common workflows
Daily content briefing
Schedule one run every morning for your target country.
Send the dataset to Slack, email, Google Sheets, or a BI dashboard.
Regional comparison
Run the actor for US, GB, DE, IN, and BR.
Join the results by timestamp and compare titles, channels, and categories.
Creator inspiration board
Export titles and thumbnails into a spreadsheet.
Review hooks, formats, durations, and channels during planning meetings.
News monitoring
Use the news category and a small result limit.
Alert your team when new high-interest topics appear.
Integrations
You can connect this actor to:
- Google Sheets exports for editorial planning.
- Make or Zapier for alerting workflows.
- Slack or Discord notifications for daily trend digests.
- BigQuery, Snowflake, or PostgreSQL for historical trend analysis.
- Apify webhooks for event-driven automation.
- Actor tasks for scheduled country/category monitoring.
API usage
Node.js
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('automation-lab/youtube-trending-videos-scraper').call({region: 'US',category: 'all',maxItems: 25,language: 'en',fallbackToSearch: true,});const { items } = await client.dataset(run.defaultDatasetId).listItems();console.log(items);
Python
from apify_client import ApifyClientimport osclient = ApifyClient(os.environ['APIFY_TOKEN'])run = client.actor('automation-lab/youtube-trending-videos-scraper').call(run_input={'region': 'US','category': 'all','maxItems': 25,'language': 'en','fallbackToSearch': True,})items = client.dataset(run['defaultDatasetId']).list_items().itemsprint(items)
cURL
curl -X POST "https://api.apify.com/v2/acts/automation-lab~youtube-trending-videos-scraper/runs?token=$APIFY_TOKEN" \-H 'Content-Type: application/json' \-d '{"region":"US","category":"all","maxItems":25,"language":"en","fallbackToSearch":true}'
MCP integration
Use Apify MCP to run this actor from Claude Code, Claude Desktop, or compatible MCP clients.
MCP endpoint:
https://mcp.apify.com/?tools=automation-lab/youtube-trending-videos-scraper
Claude Code setup:
$claude mcp add apify-youtube-trending https://mcp.apify.com/?tools=automation-lab/youtube-trending-videos-scraper
Claude Desktop JSON config:
{"mcpServers": {"apify-youtube-trending": {"url": "https://mcp.apify.com/?tools=automation-lab/youtube-trending-videos-scraper"}}}
Example prompts:
- "Run the YouTube Trending Videos Scraper for US music and summarize the top 10 titles."
- "Collect trending gaming videos for GB and export the dataset URL."
- "Compare US and IN trending video titles from two actor runs."
Reliability notes
YouTube changes renderer structures over time.
This actor walks multiple common renderer types and skips incomplete rows instead of failing on a single malformed item.
The sourceType field is important because YouTube's public logged-out Trending page may not always expose video renderers from every network or region.
When that happens, the fallback keeps the workflow productive while remaining transparent.
Limitations
- The actor does not log in to YouTube.
- The actor does not use private cookies or user accounts.
- Likes and comments are not guaranteed from public list pages.
- View counts can be missing or approximate.
- Official category URLs may vary by country and YouTube experiment.
- Search fallback results are trending-style search results, not guaranteed official Trending rankings.
Legality
This actor collects public information visible without a YouTube account.
You are responsible for using the data in a way that complies with applicable laws, YouTube's terms, and privacy requirements.
Do not use the actor to collect private, personal, or account-only data.
FAQ
Does it require a YouTube API key?
No.
The actor uses public web pages and does not require your YouTube Data API quota.
Why do I see youtube_search_fallback in sourceType?
It means YouTube returned no video renderers on the logged-out Trending page for that request, so the actor used public search for the selected trending category.
Can I scrape multiple countries in one run?
The current version accepts one country per run.
Create multiple Apify tasks if you want a scheduled multi-country monitor.
Can I get likes and comments?
List pages do not reliably expose likes or comment counts.
Use the video URL with a separate video detail actor if you need those metrics.
Why are some view counts null?
YouTube sometimes hides or localizes view text.
The actor keeps the raw viewCountText and parses viewCount only when the text is available and recognizable.
Troubleshooting
The dataset has fewer rows than requested
YouTube may expose fewer public renderers for the selected country/category.
Try a broader category such as all, enable fallbackToSearch, or reduce maxItems.
The run fails with no videos extracted
Try a different region, confirm fallbackToSearch is enabled, and rerun with a small maxItems value.
Related scrapers
Explore other Automation Lab YouTube and social media actors:
- https://apify.com/automation-lab/youtube-scraper
- https://apify.com/automation-lab/youtube-channel-scraper
- https://apify.com/automation-lab/youtube-comments-scraper
- https://apify.com/automation-lab/youtube-transcript-scraper
- https://apify.com/automation-lab/youtube-search-scraper
Changelog
0.1
Initial version with country/category input, ranked video output, official-page parser, and transparent public search fallback.