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

Scrape ranked videos from YouTube-owned category pages and charts by region. Export video IDs, URLs, titles, channels, view counts, thumbnails, source labels, and ranks. No YouTube login, cookies, or API key needed.

- **URL**: https://apify.com/maximedupre/youtube-trending-videos-scraper.md
- **Developed by:** [Maxime Dupré](https://apify.com/maximedupre) (community)
- **Categories:** Social media, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.10 / 1,000 scraped videos

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

### 📈 YouTube trending videos scraper for regional category pages

YouTube Trending Videos Scraper collects ranked public videos from selected [YouTube](https://www.youtube.com/) category pages and charts. Choose regions such as `US`, `GB`, or `JP`, pick one or more source pages, and export one clean row per video with its rank, video ID, URL, title, channel fields, view count, duration, thumbnail, source label, and scrape time.

Use this YouTube trending videos scraper when you need a repeatable way to watch what is rising on YouTube-owned category surfaces. It is useful for content research, creator tracking, campaign planning, niche monitoring, and market research. You do not need YouTube cookies, a login, or a YouTube API key.

For a small first run, keep the default region `US`, keep **Gaming trending videos**, and leave the limit at `25` videos per source and region. The Actor saves rows during the run, so you can open the dataset as soon as results start appearing.

### ✅ What this Actor does

- Scrapes selected YouTube-owned category pages and charts.
- Supports one or more region codes in the same run.
- Lets you choose source pages such as Gaming, Sports, News, Fashion, Learning, Podcasts, Shopping, Music, YouTube Music charts, Movies, and Shows.
- Saves one dataset item per scraped video.
- Keeps the source order as the rank and exports `sourceRank` and `trendRank`.
- Adds video identity fields such as video ID, video URL, title, thumbnail, and duration when YouTube shows them.
- Adds channel fields such as channel ID, title, URL, handle, avatar, and verification status when visible.
- Adds public metrics such as view-count text and parsed view count when available.
- Works with Apify exports, API access, schedules, webhooks, and integrations.

### 📦 Data you can export

Each output row represents one video from one selected source page and region. Depending on what YouTube exposes on that page, rows can include:

- `source`, `sourceLabel`, `sourceType`, and `sourceUrl`
- `region`, `sourceRank`, and `trendRank`
- `videoId`, `videoUrl`, and `title`
- `description` when present in the source payload
- `channelId`, `channelTitle`, `channelUrl`, `channelHandle`, and `channelAvatarUrl`
- `isChannelVerified` when visible
- `publishedTimeText` and `publishedAt`
- `durationText`
- `viewCountText` and `viewCount`
- `likeCount` and `commentCount` when exposed by the selected source
- `thumbnailUrl`, `scrapedAt`, and `status`

You can export the dataset as JSON, CSV, Excel, XML, RSS, or HTML, or read the rows through the Apify API.

### 🎯 Common use cases

- Track regional YouTube category trends for content planning.
- Compare what is ranking in Gaming, News, Sports, Music, and other source pages.
- Build recurring reports for social media, creator, or market research.
- Collect video URLs and channel fields for manual review or enrichment in another tool.
- Watch category pages over time by scheduling the Actor and comparing exported datasets.

### ▶️ How to run it

1. Open the Actor and keep `US` for a quick test.
2. Choose one or more **Source pages**.
3. Keep **Videos per source and region** at `25`, or lower it for a tiny run.
4. Start the Actor.
5. Open the dataset and export the rows or connect them to your workflow.

For multi-market checks, add several two-letter country codes, such as `US`, `GB`, `IN`, and `JP`. Each region/source pair is checked separately, and each row keeps the region and source label that produced it.

### ⚙️ Input options

| Field | What to enter |
| ----- | ------------- |
| `regions` | Two-letter country codes. Default is `US`. |
| `sources` | One or more source pages or charts to collect. Default is `Gaming trending videos`. |
| `maxResultsPerSourceRegion` | Maximum videos to save for each selected source and region. Default is `25`, maximum is `50`. |

Available source choices:

- `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
- `showsTrending` - Shows storefront trending

Example input:

```json
{
  "regions": ["US", "GB"],
  "sources": ["gamingTrending", "sportsTrending", "newsTrending"],
  "maxResultsPerSourceRegion": 25
}
````

### 🧾 Output example

```json
{
  "source": "gamingTrending",
  "sourceLabel": "Gaming trending videos",
  "sourceType": "youtube_page",
  "region": "US",
  "sourceRank": 1,
  "trendRank": 1,
  "sourceUrl": "https://www.youtube.com/gaming/trending?gl=US&hl=en&persist_gl=1",
  "videoId": "_BE6aVJgM98",
  "videoUrl": "https://www.youtube.com/watch?v=_BE6aVJgM98",
  "title": "THE FIRST RACE IN BRAWL HISTORY #FormulaBrawl",
  "description": null,
  "channelId": "UCooVYzDxdwTtGYAkcPmOgOw",
  "channelTitle": "Brawl Stars and Jelle's Marble Runs",
  "channelUrl": "https://www.youtube.com/channel/UCooVYzDxdwTtGYAkcPmOgOw",
  "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",
  "viewCountText": "6,368,571 views",
  "viewCount": 6368571,
  "likeCount": null,
  "commentCount": null,
  "thumbnailUrl": "https://i.ytimg.com/vi/_BE6aVJgM98/hqdefault.jpg",
  "scrapedAt": "2026-06-09T12:23:32.227Z",
  "status": "ok"
}
```

### 💳 Pricing

This Actor uses pay-per-event pricing. You are charged for each video saved to the dataset. Runs that collect no videos do not save placeholder rows.

The local pricing artifact sets the primary **Scraped video** event at `$0.0001` per saved video, equal to `$0.10 per 1,000 videos`.

### ⚠️ Limits and caveats

- The Actor collects public data from the selected YouTube-owned source pages and charts.
- Region availability and visible fields can vary by source page.
- Some fields are `null` when YouTube does not show them on the selected page or chart.
- Relative publish text such as `21 hours ago` is saved when that is what YouTube exposes.
- Likes, comments, exact publish timestamps, descriptions, and verification badges are included only when the selected source exposes them.

### ❓ FAQ

#### 🔑 Do I need a YouTube API key?

No. The Actor is designed for public YouTube-owned pages and charts and does not ask for a YouTube API key, login, or cookies.

#### 🌍 Can I check several countries at once?

Yes. Add multiple two-letter region codes in `regions`. The Actor checks each selected source for each region and keeps the region on every output row.

#### 📊 Is the output ranked?

Yes. The Actor keeps the source order and saves `trendRank` for each video within a source and region.

### 📝 Changelog

- 0.1: Initial release.

### 🆘 Support

For issues, questions, or feature requests, [file a ticket](https://console.apify.com/actors/maximedupre~youtube-trending-videos-scraper/issues) and I'll fix or implement it in less than 24h 🫡

### 🔗 Other actors

- [YouTube Channel Search Scraper ↗](https://apify.com/maximedupre/youtube-channel-search-scraper) - Find public YouTube channels from search keywords.
- [YouTube Channel Scraper ↗](https://apify.com/maximedupre/youtube-channel-scraper) - Scrape profiles and video rows from known YouTube channels.
- [YouTube Channel Statistics Scraper ↗](https://apify.com/maximedupre/youtube-channel-statistics-scraper) - Export subscriber, view, and video counts for known channels.
- [Social Media Stats Checker ↗](https://apify.com/maximedupre/social-media-stats-checker) - Compare public profile stats across YouTube and other social platforms.
- [Twitter Media Scraper ↗](https://apify.com/maximedupre/twitter-media-scraper) - Extract images, videos, and GIFs from public X/Twitter posts.

**Made with ❤️ by Maxime Dupré**

# Actor input Schema

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

Two-letter country codes, such as US, GB, IN, or JP. Each region is checked separately.

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

Choose one or more YouTube category pages or charts to collect.

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

Maximum rows to save for each selected source page in each region.

## Actor input object example

```json
{
  "regions": [
    "US",
    "GB"
  ],
  "sources": [
    "gamingTrending",
    "sportsTrending",
    "newsTrending"
  ],
  "maxResultsPerSourceRegion": 25
}
```

# Actor output Schema

## `results` (type: `string`):

Open the dataset with one item per scraped YouTube video.

# 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 = {
    "regions": [
        "US",
        "GB"
    ],
    "sources": [
        "gamingTrending",
        "sportsTrending",
        "newsTrending"
    ],
    "maxResultsPerSourceRegion": 25
};

// Run the Actor and wait for it to finish
const run = await client.actor("maximedupre/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 = {
    "regions": [
        "US",
        "GB",
    ],
    "sources": [
        "gamingTrending",
        "sportsTrending",
        "newsTrending",
    ],
    "maxResultsPerSourceRegion": 25,
}

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

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

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

```

## CLI example

```bash
echo '{
  "regions": [
    "US",
    "GB"
  ],
  "sources": [
    "gamingTrending",
    "sportsTrending",
    "newsTrending"
  ],
  "maxResultsPerSourceRegion": 25
}' |
apify call maximedupre/youtube-trending-videos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=maximedupre/youtube-trending-videos-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Trending Videos Scraper",
        "description": "Scrape ranked videos from YouTube-owned category pages and charts by region. Export video IDs, URLs, titles, channels, view counts, thumbnails, source labels, and ranks. No YouTube login, cookies, or API key needed.",
        "version": "0.1",
        "x-build-id": "jiMiTYKoqGtFV8hcK"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/maximedupre~youtube-trending-videos-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-maximedupre-youtube-trending-videos-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/maximedupre~youtube-trending-videos-scraper/runs": {
            "post": {
                "operationId": "runs-sync-maximedupre-youtube-trending-videos-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/maximedupre~youtube-trending-videos-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-maximedupre-youtube-trending-videos-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "regions"
                ],
                "properties": {
                    "regions": {
                        "title": "Regions",
                        "minItems": 1,
                        "maxItems": 50,
                        "type": "array",
                        "description": "Two-letter country codes, such as US, GB, IN, or JP. Each region is checked separately.",
                        "items": {
                            "type": "string",
                            "pattern": "^[A-Za-z]{2}$",
                            "minLength": 2,
                            "maxLength": 2
                        },
                        "default": [
                            "US"
                        ]
                    },
                    "sources": {
                        "title": "Source pages",
                        "minItems": 1,
                        "uniqueItems": true,
                        "type": "array",
                        "description": "Choose one or more YouTube category pages or charts to collect.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "gamingTrending",
                                "sportsTrending",
                                "newsTrending",
                                "fashionTrending",
                                "learningTrending",
                                "coursesTrending",
                                "podcastsTrending",
                                "shoppingTrending",
                                "musicTrending",
                                "musicCharts",
                                "moviesTrending",
                                "showsTrending"
                            ],
                            "enumTitles": [
                                "Gaming trending videos",
                                "Sports category videos",
                                "News category videos",
                                "Fashion category videos",
                                "Learning category videos",
                                "Courses category videos",
                                "Podcast category videos",
                                "Shopping category videos",
                                "Music category videos",
                                "YouTube Music charts",
                                "Movies storefront trending",
                                "Shows storefront trending"
                            ]
                        },
                        "default": [
                            "gamingTrending"
                        ]
                    },
                    "maxResultsPerSourceRegion": {
                        "title": "Videos per source and region",
                        "minimum": 1,
                        "maximum": 50,
                        "type": "integer",
                        "description": "Maximum rows to save for each selected source page in each region.",
                        "default": 25
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
