# YouTube Trending Videos Scraper (`parsebird/youtube-trending-videos-scraper`) Actor

Scrape YouTube's Gaming, Sports, News, Fashion, Learning, Courses, Podcasts, Shopping, Music, Music Charts, and Movies trending pages for any country — titles, channels, views, and more.

- **URL**: https://apify.com/parsebird/youtube-trending-videos-scraper.md
- **Developed by:** [ParseBird](https://apify.com/parsebird) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.59 / 1,000 trending videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### YouTube Trending Videos Scraper

**YouTube Trending Videos Scraper** pulls videos straight off [YouTube's](https://www.youtube.com) category hub pages and Music Charts — Gaming, Sports, News, Fashion, Learning, Courses, Podcasts, Shopping, Music, Music Charts, and Movies — for any country you choose. No login, no official API quota, no browser required.

<table><tr>
<td style="border-left:4px solid #1C1917;padding:12px 16px;font-weight:600">
Pick any mix of 11 sources and any two-letter country codes, and get title, channel, view count, duration, and thumbnail for up to 50 videos per source per region in one run.
</td>
</tr></table>

<br>

##### Copy to your AI assistant

Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor: Actor ID `parsebird/youtube-trending-videos-scraper` on Apify — call it with `ApifyClient` (`client.actor("parsebird/youtube-trending-videos-scraper").call(run_input={"sources": ["gamingTrending", "musicTrending"], "regions": ["US", "GB"], "maxResultsPerSourceRegion": 50})`) — inputs are `sources` (array, choose from `gamingTrending`, `sportsTrending`, `newsTrending`, `fashionTrending`, `learningTrending`, `coursesTrending`, `podcastsTrending`, `shoppingTrending`, `musicTrending`, `musicCharts`, `moviesTrending`; default `["gamingTrending"]`), `regions` (array of two-letter country codes, default `["US"]`), and `maxResultsPerSourceRegion` (integer 1–50, default 50) — output is one dataset row per video per source per region with `source`, `region`, `sourceRank`, `videoId`, `title`, `description`, `channelId`, `channelTitle`, `channelHandle`, `channelAvatarUrl`, `isChannelVerified`, `publishedTimeText`, `publishedAt`, `durationText`, `viewCount`, `likeCount`, `commentCount`, `thumbnailUrl` — API docs at `https://apify.com/parsebird/youtube-trending-videos-scraper/api` and API tokens at `https://console.apify.com/settings/integrations`.

### What does YouTube Trending Videos Scraper do?

This YouTube trending scraper reads the same category pages YouTube itself renders for visitors, region by region:

- 🌍 Any two-letter country code (`US`, `GB`, `JP`, ...) — each source is re-fetched per region so you get genuinely region-specific results, not a single global list
- 🗂️ 11 sources in one run: Gaming, Sports, News, Fashion, Learning, Courses, Podcasts, Shopping, Music, Music Charts, and Movies
- 🏆 `sourceRank` gives each video's position on the page, so you can track how a category's trending list shifts over time
- 📊 Title, channel name/ID/handle/avatar, verified badge, publish time text, duration, view count, and thumbnail — whatever YouTube exposes on that specific page
- 🎵 Music Charts pulls from YouTube's dedicated [charts.youtube.com](https://charts.youtube.com) weekly Top Videos chart, with real chart rank, artist credits, and release date
- 🧯 Batches of source/region combinations run in parallel; one blocked or empty combination never stops the rest

Run it from the Apify Console with no code, or call it from Python/JavaScript via the [Apify API](https://docs.apify.com/api/v2) — schedule daily pulls to track how trending lists change, wire it into an [integration](https://apify.com/integrations) (Make, Zapier, n8n), and export results as JSON, CSV, Excel, HTML, or XML straight from the dataset.

### Input parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| sources | array of strings | No | `["gamingTrending"]` | One or more source pages or charts to collect. See the full list below. |
| regions | array of strings | No | `["US"]` | Two-letter country codes. |
| maxResultsPerSourceRegion | integer | No | 50 | Maximum videos to save for each selected source and region (max 50). |

**Available sources**: `gamingTrending` (Gaming trending videos), `sportsTrending` (Sports category videos), `newsTrending` (News category videos), `fashionTrending` (Fashion category videos), `learningTrending` (Learning category videos), `coursesTrending` (Courses category videos), `podcastsTrending` (Podcast category videos), `shoppingTrending` (Shopping category videos), `musicTrending` (Music category videos), `musicCharts` (YouTube Music charts), `moviesTrending` (Movies storefront trending).

### Output example

```json
{
  "source": "gamingTrending",
  "region": "US",
  "sourceRank": 1,
  "videoId": "_BE6aVJgM98",
  "title": "THE FIRST RACE IN BRAWL HISTORY #FormulaBrawl",
  "description": null,
  "channelId": "UCooVYzDxdwTtGYAkcPmOgOw",
  "channelTitle": "Brawl Stars and Jelle's Marble Runs",
  "channelHandle": null,
  "channelAvatarUrl": "https://yt3.ggpht.com/example=s68-c-k-c0x00ffffff-no-rj",
  "isChannelVerified": null,
  "publishedTimeText": "21 hours ago",
  "publishedAt": null,
  "durationText": "2:59",
  "viewCount": 6368571,
  "likeCount": null,
  "commentCount": null,
  "thumbnailUrl": "https://i.ytimg.com/vi/_BE6aVJgM98/hqdefault.jpg"
}
```

Every row shares this field set; fields YouTube doesn't expose on that particular source page come back `null` (this is normal — hub pages never expose like/comment counts, for example, and only Music Charts exposes an absolute `publishedAt` date). Download the [full results](https://apify.com/parsebird/youtube-trending-videos-scraper) as JSON, CSV, Excel, HTML, or XML from the Actor's dataset, or pull them with the [Apify API](https://docs.apify.com/api/v2#/reference/datasets).

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("parsebird/youtube-trending-videos-scraper").call(run_input={
    "sources": ["gamingTrending", "musicTrending"],
    "regions": ["US", "GB"],
    "maxResultsPerSourceRegion": 50,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["source"], item["region"], item["sourceRank"], item["title"])
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_API_TOKEN>' });
const run = await client.actor('parsebird/youtube-trending-videos-scraper').call({
    sources: ['gamingTrending', 'musicTrending'],
    regions: ['US', 'GB'],
    maxResultsPerSourceRegion: 50,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

### Use cases

- Track how trending videos in your niche (Gaming, News, Music, ...) shift day to day across multiple countries
- Feed a content-strategy dashboard with what's currently trending by category and region
- Monitor a competitor's category or watch which creators break into a country's trending list
- Build a "what's trending" widget or newsletter section sourced straight from YouTube
- Compare a music video's performance across countries using YouTube Music Charts' weekly rank

### How it works

1. Choose your `sources` and `regions`, and a `maxResultsPerSourceRegion` cap.
2. For each source × region combination, the Actor requests YouTube's own hub page for that region (or, for `musicCharts`, YouTube Music's chart data) — the same content a visitor from that country would see.
3. It reads the page's embedded data directly, walking every shelf and card format YouTube uses (including its newer card layouts) so nothing gets missed.
4. Each video becomes one row with a `sourceRank` reflecting its position on the page, pushed to the dataset as soon as it's found.
5. A failed or empty source/region combination is logged and skipped — it never stops the rest of the batch.

### How much does it cost to scrape YouTube trending videos?

| Event | Price per event | Price per 1,000 |
|-------|----------------|-----------------|
| video-scraped | $0.00199 | **$1.99** |

You're billed one `video-scraped` event per video row saved — failed or empty source/region combinations are never charged. Pricing improves automatically with your Apify plan tier (Bronze $1.89/1,000, Silver $1.79/1,000, Gold $1.59/1,000). Apify's free monthly platform credits cover a meaningful number of runs before you pay anything out of pocket.

### Input/Output

Set `sources`, `regions`, and `maxResultsPerSourceRegion` from the Input tab in Apify Console, or pass them as JSON via the [API](https://docs.apify.com/api/v2). Results land in the run's default dataset — open the **Output** tab to preview rows, or export as JSON, CSV, Excel, HTML, or XML.

### Is it legal to scrape YouTube trending videos?

Scraping publicly available data — the same video listings any visitor sees on YouTube's own trending pages — for research, analysis, or monitoring is common practice, but always review YouTube's Terms of Service for your specific use case and avoid republishing content itself without permission. Read more on [Apify's blog about the legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

### Other YouTube scrapers by ParseBird

- [YouTube Shorts Downloader](https://apify.com/parsebird/youtube-shorts-downloader) — get direct source media links for any YouTube Short
- [YouTube Transcript Scraper](https://apify.com/parsebird/youtube-transcript-scraper) — get captions or Whisper-transcribed text for any video
- [YouTube Thumbnail Downloader](https://apify.com/parsebird/youtube-thumbnail-downloader) — grab every thumbnail resolution for a video
- [YouTube Search Scraper](https://apify.com/parsebird/youtube-search-scraper) — scrape search results for any keyword
- [YouTube Channel Search Scraper](https://apify.com/parsebird/youtube-channel-search-scraper) — find channels matching a query
- [YouTube Community Posts Scraper](https://apify.com/parsebird/youtube-community-posts-scraper) — pull a channel's Community tab posts

### FAQ

**Why are `podcastsTrending`, `shoppingTrending`, and `moviesTrending` sometimes empty?**
These three YouTube hubs consistently return no results for a guest (non-signed-in) session in every region we've tested — YouTube appears to require a signed-in Google account with regional store access for them. They're kept as valid source options in case that changes, but plan for them to come back empty.

**Why does `gamingTrending` return so few results?**
The Gaming hub page itself only surfaces a couple of video shelves by default (it's mostly a category-browsing page), so its result count is usually in the single digits per region even at the maximum `maxResultsPerSourceRegion`. This reflects what YouTube actually shows, not a limitation of the Actor.

**What does `sourceRank` mean for Music Charts vs. the other sources?**
For `musicCharts`, it's YouTube Music's own official weekly chart position. For every other source, it's the video's position on the hub page at the time of the run — useful for tracking movement, but not an official YouTube ranking.

**Why is `publishedAt` usually null?**
YouTube's hub pages only expose a relative time string (`publishedTimeText`, e.g. "21 hours ago"), not an absolute timestamp. Only `musicCharts` exposes a real release date, which is mapped to `publishedAt`.

**Can I run this on a schedule?**
Yes — use Apify's built-in [Scheduler](https://docs.apify.com/platform/schedules) to track how a region's trending list changes daily or hourly.

**I found a bug or a source/region combo that looks wrong — where do I report it?**
Open an issue on the Actor's **Issues** tab in Apify Console with the source and region that looked off, and it'll get looked at.

# Changelog

This Actor's version history is a separate document: https://apify.com/parsebird/youtube-trending-videos-scraper/changelog.md

# Actor input Schema

## `sources` (type: `array`):

One or more source pages or charts to collect.

## `regions` (type: `array`):

Two-letter country codes (e.g. US, GB, JP).

## `maxResultsPerSourceRegion` (type: `integer`):

Maximum videos to save for each selected source and region.

## `maxConcurrency` (type: `integer`):

How many source/region combinations to fetch in parallel.

## `proxyConfiguration` (type: `object`):

Optional proxy for reaching YouTube. Leave off to run direct; add one if you see blocked or empty results at high volume.

## Actor input object example

```json
{
  "sources": [
    "gamingTrending"
  ],
  "regions": [
    "US"
  ],
  "maxResultsPerSourceRegion": 50,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sources": [
        "gamingTrending"
    ],
    "regions": [
        "US"
    ],
    "maxResultsPerSourceRegion": 50,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("parsebird/youtube-trending-videos-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "sources": ["gamingTrending"],
    "regions": ["US"],
    "maxResultsPerSourceRegion": 50,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("parsebird/youtube-trending-videos-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sources": [
    "gamingTrending"
  ],
  "regions": [
    "US"
  ],
  "maxResultsPerSourceRegion": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call parsebird/youtube-trending-videos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parsebird/youtube-trending-videos-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/RijiptEd2yg4JkFsg/builds/9zWGPJgsFzldRj55a/openapi.json
