YouTube Trending Videos Scraper avatar

YouTube Trending Videos Scraper

Pricing

Pay per event

Go to Apify Store
YouTube Trending Videos Scraper

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

Stas Persiianenko

Maintained by Community

Actor 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.

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 gl region 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?

FieldDescription
rankRank within the returned dataset.
videoIdYouTube video identifier.
urlDirect https://www.youtube.com/watch?v=... URL.
titleVideo title.
channelNameChannel name when available.
channelUrlChannel URL when available.
publishedTimeTextHuman-readable freshness text, such as 2 days ago.
viewCountTextHuman-readable views text.
viewCountParsed numeric view count when possible.
durationTextVideo duration text.
thumbnailUrlBest available thumbnail URL.
badgesRenderer badges such as verified labels when available.
categoryCategory input used for the run.
regionCountry code input used for the run.
sourceTypeOfficial trending page or fallback search.
sourceUrlURL fetched for the returned rows.
scrapedAtISO timestamp for the scrape.

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.

  1. Open the actor on Apify.
  2. Choose a country code, for example US, GB, DE, IN, or BR.
  3. Pick a category such as all, music, gaming, or news.
  4. Set maxItems to the number of videos you want.
  5. Keep fallbackToSearch enabled unless you only want official-page rows.
  6. Start the run.
  7. Export the dataset as JSON, CSV, Excel, XML, or RSS.

Input options

region

Two-letter country code used by YouTube.

Examples:

  • US
  • GB
  • DE
  • IN
  • BR
  • CA
  • AU
  • JP

category

Supported values:

  • all
  • music
  • gaming
  • movies
  • news
  • sports
  • fashion
  • learning

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: 25 to validate your workflow.
  • Schedule daily or hourly runs for trend monitoring.
  • Store sourceType in your downstream table so you can filter official-page rows separately.
  • Compare the same category across multiple regions.
  • Use videoId as a stable deduplication key.
  • Keep thumbnails for editorial review boards.
  • Use viewCount for 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 ApifyClient
import os
client = 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().items
print(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.

Explore other Automation Lab YouTube and social media actors:

Changelog

0.1

Initial version with country/category input, ranked video output, official-page parser, and transparent public search fallback.