# YouTube Trending Scraper (`powerai/youtube-trending-scraper`) Actor

Export YouTube trending videos for a region—titles, channels, stats, thumbnails, and descriptions in one run.

- **URL**: https://apify.com/powerai/youtube-trending-scraper.md
- **Developed by:** [PowerAI](https://apify.com/powerai) (community)
- **Categories:** Social media, Videos, Integrations
- **Stats:** 7 total users, 1 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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 Scraper

Pull the **trending video chart** for a **region** you choose (for example United States or United Kingdom). Each dataset row is one video with title, channel, engagement counts, publish hints, duration text, thumbnail sizes, and description when available.

### Who it’s for

- **Creators and analysts** tracking what is popular in a given market.  
- **Marketers** who need structured rows for reporting or alerts.  
- **Automation** that runs on a schedule to snapshot the chart.

### What you can do with it

- **Pick a region** so the chart matches that market.  
- **Choose a chart focus** (general, music-focused, gaming, or movies-style lists when supported).  
- **Optionally set a language hint** for how titles and metadata are preferred.  
- **Cap how many rows** to keep so exports stay small.

### How it works (in plain terms)

You choose a region and options, then the run fetches the current trending list in one step and writes **one row per video** up to your maximum. There is no manual paging—the snapshot reflects what the chart returns for that request.

### Input

| Field | Required | What it means |
|-------|----------|----------------|
| **Region** (`region`) | Yes | Country or region code for the chart (e.g. **US**, **GB**). |
| **Chart focus** (`trendType`) | No | General, music, gaming, or movies—default **General (now)**. |
| **Language hint** (`language`) | No | Optional locale or language hint (e.g. **en**). |
| **Maximum results** (`maxResults`) | No | How many videos to keep from the list (default **50**). |

### Output

- **One row per video** (until your cap). Duplicates are skipped when the same **`videoId`** appears twice.  
- **Video**: typically **`type`**, **`videoId`**, **`title`**, **`description`**, **`lengthText`**, **`publishedAt`**, **`publishedTimeText`**.  
- **Channel**: **`channelTitle`**, **`channelId`**, **`channelThumbnail`** (may be null).  
- **Engagement** (often as strings): **`viewCount`**, **`likeCount`**, **`commentCount`**.  
- **Thumbnails**: **`thumbnail`** as an array of objects with **`url`**, **`width`**, **`height`**; **`richThumbnail`** when present.  
- **Extra fields**: rows may include **additional properties** beyond those listed.  
- **Run context**: **`region`** repeats the code you used; **`trendType`** is included when you chose a non-default focus; **`scrapedAt`** is when the row was saved.

Availability of exact fields can vary by video and over time.

#### Sample output (one dataset row, illustrative)

```json
{
	"type": "video",
	"videoId": "XelMqi0jlvk",
	"title": "Christmas Songs Playlist🎄Top 2 Hour Christmas Songs 🎅 Best Christmas Music 2026",
	"channelTitle": "Christmas Songs and Carols - Love to Sing",
	"channelId": "UCn0JHLJWiO3_Y5xfNPcF_Ug",
	"channelThumbnail": null,
	"description": "# Christmas Songs Playlist 🎄 Top 2 Hour Christmas Songs 🎅 Best Christmas Music 2026\n\nEnjoy the festive classic Top Christmas Songs of All Time playlist! This cheerful top Christmas music mix is perfect for singing along, bringing joy and holiday spirit to any celebration. Whether you’re at a Christmas party, cozying up with family, or in the classroom, our best Christmas Songs of All Time playlist if full of timeless Christmas tunes that everyone loves. Let the fun melody and catchy chorus bring smiles and create a cozy holiday atmosphere!\n\nHoliday hits for 2025 featuring all the best and popular Christmas songs you love with lyrics to sing along and get you into the Christmas spirit 🎅  A Merry Christmas music playlist guaranteed to fill your heart with Christmas joy! A perfect mix of Christmas music to share with family and friends for a Merry Yuletide Christmas 🎄\n\n## Top Christmas Songs of All Time Playlist:\n00:00:00 All I Want For Christmas Is You\n00:04:03 Santa Claus is Coming to Town\n00:07:02 Please Come Home For Christmas\n00:09:49 Rockin' Around the Christmas Tree\n00:11:54 Holly Jolly Christmas\n00:13:47 Feliz Navidad\n00:17:40 Merry Christmas Everyone\n00:21:12 Last Christmas\n00:25:41 It's the Most Wonderful Time of the Year\n00:28:05 Jingle Bell Rock\n00:30:22 Let it Snow\n00:32:41 O Christmas Tree\n00:34:51 Rudolph the Red Nosed Reindeer\n00:36:16 Ting a Ling a Jingle\n00:39:01 Christmas Alphabet\n00:41:12 Christmas Holiday Medley\n00:45:00 I'm the Happiest Christmas Tree\n00:47:08 Have Yourself a Merry Little Christmas\n00:50:57 Jolly Old Saint Nicholas\n00:52:43 The BER Song\n00:55:32 O Come All Ye Faithful\n00:58:02 Joy to the World\n00:59:51 Silent Night\n01:03:26 12 Days of Christmas\n01:07:38 Deck the Halls\n01:09:39 Jingle Bells\n01:11:17 Religious Medley\n01:17:34 Away in a Manger\n01:19:30 Auld Lang Syne\n01:24:22 We Wish You a Merry Christmas\n01:26:27 Angels From the Realms of Glory\n01:29:07 Children Go Where I Send Thee\n01:33:06 Christ was Born on Christmas Day\n01:35:37 Ding Dong Merrily on High\n01:37:33 Go Tell it on the Mountain\n01:40:21 God Rest You Merry Gentlemen\n01:44:55 Good King Wenceslas\n01:47:55 Grandma Got Runover By a Reindeer\n01:51:26 Here We Come a Carolling\n01:53:37 How Great Thou Art\n01:58:33 It Came Upon a Midnight Clear\n02:02:04 Jolly Old Saint Nicholas\n02:03:53 O Come O Come Emmanuel\n\nChristmas Songs and Carols Love to Sing is your go-to destination for Top Christmas Songs and Carols that are joyful, sing-along music that brings people together! We create the best Christmas songs and carols on the internet, Love to Sing offers a wide range of festive and family-friendly music that lifts spirits and spreads holiday cheer. Whether it’s for a Christmas celebration, a Christmas gathering, or simply enjoying the magic of the Christmas season, Christmas Songs and Carols Love to Sing’s Top Christmas Songs will have everyone singing along! 🎶❤️ \n\nListen to the top Jingle Bells Christmas Song on YouTube - Love to Sing Jingle Bells https://www.youtube.com/watch?v=3CWJNqyub3o 🔔 Over 200 Million views! \n\nWe Wish You a Merry Christmas https://www.youtube.com/watch?v=g-OF7KGyDis it's the top version on YouTube🎄 \n\nCheck out our 12 Days of Christmas https://www.youtube.com/watch?v=oyEyMjdD2uk 🎅 \n\nSing along with the Best Feliz Navidad of all time! https://www.youtube.com/watch?v=YNGsde7zWzw\n\nTop 90 Christmas Songs Playlist https://www.youtube.com/watch?v=M51fAus2Vnc\n\n🎵 Subscribe: http://www.youtube.com/c/ChristmasSongsandCarolsLovetoSing?sub_confirmation=1 \n\n*Listen to Love to Sing on streaming platforms*\n\nSpotify: https://open.spotify.com/artist/5dz42IMRAYRfEn0igXDjoz?si=B3u0krOjSyWBff0KzOVFMw&dl_branch=1     \n\nYouTube Music: https://music.youtube.com/channel/UCjDkTzwSifCid5vl3gLtfbQ\n\nApple Music: https://music.apple.com/us/artist/love-to-sing/351051489\n\n#christmassongs\n#christmasmusic\n#christmassongsandcarols\n#christmasplaylist\n\n*Follow us on social media*\nTiktok: https://www.tiktok.com/@christmassongsandcarols\nFacebook: https://www.facebook.com/christmassongsandcarols\nInstagram: https://www.instagram.com/christmassongsandcarols/\nTwitter: https://x.com/SongsCarols\n\nFeel the Christmas JOY with Christmas Songs and Carols - Love to Sing\n© Love to Sing Ltd",
	"viewCount": "316056",
	"likeCount": "1117",
	"commentCount": "61",
	"publishedAt": "2025-12-09T11:30:38Z",
	"publishedTimeText": "4 months ago",
	"lengthText": "2:07:14",
	"thumbnail": [
		{
			"url": "https://i.ytimg.com/vi/XelMqi0jlvk/default.jpg",
			"width": 120,
			"height": 90
		},
		{
			"url": "https://i.ytimg.com/vi/XelMqi0jlvk/mqdefault.jpg",
			"width": 320,
			"height": 180
		},
		{
			"url": "https://i.ytimg.com/vi/XelMqi0jlvk/hqdefault.jpg",
			"width": 480,
			"height": 360
		},
		{
			"url": "https://i.ytimg.com/vi/XelMqi0jlvk/sddefault.jpg",
			"width": 640,
			"height": 480
		},
		{
			"url": "https://i.ytimg.com/vi/XelMqi0jlvk/maxresdefault.jpg",
			"width": 1280,
			"height": 720
		}
	],
	"richThumbnail": null,
	"region": "US",
	"trendType": "now",
	"scrapedAt": "2026-03-26T09:07:32.800Z"
}
````

# Actor input Schema

## `region` (type: `string`):

Which country or region’s trending chart to use (for example US, GB, CA, IN).

## `trendType` (type: `string`):

What kind of trending list to pull for that region.

## `language` (type: `string`):

Optional language or locale hint for titles and metadata (for example en).

## `maxResults` (type: `integer`):

Upper limit on how many video rows to keep from the returned chart.

## Actor input object example

```json
{
  "region": "US",
  "trendType": "now",
  "maxResults": 50
}
```

# 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 = {
    "region": "US",
    "trendType": "now",
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("powerai/youtube-trending-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 = {
    "region": "US",
    "trendType": "now",
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("powerai/youtube-trending-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 '{
  "region": "US",
  "trendType": "now",
  "maxResults": 50
}' |
apify call powerai/youtube-trending-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "YouTube Trending Scraper",
        "description": "Export YouTube trending videos for a region—titles, channels, stats, thumbnails, and descriptions in one run.",
        "version": "0.0",
        "x-build-id": "dXBUcjK2DjTUe6OxJ"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/powerai~youtube-trending-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-powerai-youtube-trending-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/powerai~youtube-trending-scraper/runs": {
            "post": {
                "operationId": "runs-sync-powerai-youtube-trending-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/powerai~youtube-trending-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-powerai-youtube-trending-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": [
                    "region"
                ],
                "properties": {
                    "region": {
                        "title": "Region",
                        "type": "string",
                        "description": "Which country or region’s trending chart to use (for example US, GB, CA, IN).",
                        "default": "US"
                    },
                    "trendType": {
                        "title": "Chart focus",
                        "enum": [
                            "now",
                            "music",
                            "games",
                            "movies"
                        ],
                        "type": "string",
                        "description": "What kind of trending list to pull for that region.",
                        "default": "now"
                    },
                    "language": {
                        "title": "Language hint",
                        "type": "string",
                        "description": "Optional language or locale hint for titles and metadata (for example en)."
                    },
                    "maxResults": {
                        "title": "Maximum results",
                        "minimum": 50,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Upper limit on how many video rows to keep from the returned chart.",
                        "default": 50
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
