scraping-youtube-trending-videos — Claude Code skill
Extracts YouTube trending videos by category and country through Apify. Pulls view counts, likes, tags, and channel metadata into CSV or JSON.
npx skills add apidojo-io/apidojo-skills --skill scraping-youtube-trending-videos -a claude-codeWhat scraping-youtube-trending-videos does
The skill instructs your agent on calling the apidojo/youtube-trending-scraper actor on Apify. It accepts category filters (n, music, movies, gaming), country codes via gl, and language codes via hl. Each returned entry contains the video ID, title, URL, description, view and like counts, duration, and channel metadata.
Execution happens via scripts/run_actor.js, a direct REST API call, or the Apify MCP call_actor tool. You can limit the output with maxItems and transform records with customMapFunction. Results export directly to CSV or JSON files.
An $APIFY_TOKEN is required for authentication against Apify endpoints. If a target country lacks a dedicated gaming or movie trending tab, fall back to category n.
What it helps with
- extract trending YouTube videos for a specific country code
- collect view counts, likes, and durations of viral videos
- filter trending content by gaming, music, or movies
- export point-in-time YouTube trending snapshots to CSV or JSON
Example prompts for the agent
- Fetch the top 50 trending YouTube videos in the US and save them to results.json
- Show me what gaming videos are trending in Great Britain right now
- Scrape today's music trends on YouTube with view counts and channel details
How to install scraping-youtube-trending-videos
1Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-youtube-trending-videos -a claude-code2Manually: put the files in place
~/.claude/skills/scraping-youtube-trending-videos/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/scraping-youtube-trending-videos/
1Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-youtube-trending-videos -a codex2Manually: put the files in place
.agents/skills/scraping-youtube-trending-videos/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-youtube-trending-videos -a cursor2Manually: put the files in place
.cursor/skills/scraping-youtube-trending-videos/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install apidojo-io/apidojo-skills scraping-youtube-trending-videos2Manually: put the files in place
.github/skills/scraping-youtube-trending-videos/SKILL.md1Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-youtube-trending-videos -a gemini-cli2Platform CLI
gemini skills install https://github.com/apidojo-io/apidojo-skills --path skills/primitives/scraping-youtube-trending-videosManually: put the files in place
.devin/skills/scraping-youtube-trending-videos/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add apidojo-io/apidojo-skills --skill scraping-youtube-trending-videos -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about scraping-youtube-trending-videos
How do I install scraping-youtube-trending-videos in Claude Code?
Run npx skills add apidojo-io/apidojo-skills --skill scraping-youtube-trending-videos -a claude-code in your terminal.
What does scraping-youtube-trending-videos do?
It triggers an Apify scraper to pull YouTube trending feeds filtered by country and category, returning structured video metrics.
What happens if a category returns no results?
Some regional YouTube sites lack specific category tabs. When that happens, set the type parameter back to n.
Source text
SKILL.md · Apache-2.0
---
name: scraping-youtube-trending-videos
description: >
Extracts YouTube trending videos by category and country using apidojo's YouTube Trending
Scraper on Apify. Triggers when the user asks to: get trending YouTube videos, scrape what's
trending on YouTube today, fetch YouTube trending videos in a specific country, get trending
gaming or music videos on YouTube, export the YouTube trending page data, find viral YouTube
videos right now, or collect top trending YouTube content by category. Returns video title,
URL, view count, like count, channel info, description, and thumbnail per video.
Ideal for content researchers, trend analysts, and YouTube marketers.
license: Apache-2.0
metadata:
author: apidojo
version: "1.0"
apify-actor: apidojo/youtube-trending-scraper
---
# Scraping Youtube Trending Videos
Raw data collection. No assumed use case — returns the full dataset for downstream analysis.
---
## Inputs
| Parameter | Type | Required | Default | Notes |
|-----------|------|----------|---------|-------|
| `type` | string | Optional | `n` | Trending category: `n` (now), `music`, `movies`, `gaming` |
| `gl` | string | Optional | `us` | Country code (e.g. `US`, `GB`) |
| `hl` | string | Optional | `en` | Language code (e.g. `en`) |
| `maxItems` | number | Optional | Unlimited | Maximum videos to return |
| `customMapFunction` | string | Optional | — | JavaScript function to transform each output object |
## How to Run
### Using run_actor.js (recommended)
```bash
# Quick answer (table)
node scripts/run_actor.js --actor "apidojo~youtube-trending-scraper" --input '{"type": "n", "gl": "us", "hl": "en", "maxItems": 50}'
# Save as CSV
node scripts/run_actor.js --actor "apidojo~youtube-trending-scraper" --input '{"type": "n", "gl": "us", "hl": "en", "maxItems": 50}' --output results.csv --format csv
# Save as JSON
node scripts/run_actor.js --actor "apidojo~youtube-trending-scraper" --input '{"type": "n", "gl": "us", "hl": "en", "maxItems": 50}' --output results.json --format json
```
### REST API fallback
```bash
curl -X POST "https://api.apify.com/v2/acts/apidojo~youtube-trending-scraper/runs" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"type": "n", "gl": "us", "hl": "en", "maxItems": 50}'
```
If Apify MCP is available:
Use the Apify MCP `call_actor` tool with actor `apidojo~youtube-trending-scraper` and the input above.
---
## Output Fields
| Field | Type | Description |
|-------|------|-------------|
| `type` | string | Always `video` |
| `id` | string | Video ID |
| `title` | string | Video title |
| `url` | string | Video URL |
| `description` | string | Video description |
| `duration` | number | Duration in seconds |
| `views` | number | View count |
| `likes` | number | Like count |
| `status` | string | Availability status |
| `channel.id` | string | Channel ID |
| `channel.name` | string | Channel name |
| `channel.url` | string | Channel URL |
| `keywords` | array | Video tags/keywords |
| `isLive` | boolean | Live stream flag |
| `thumbnails` | array | Thumbnail objects |
## Edge Cases
- **No results for category**: Some countries may not have all category pages. Fall back to type=`n`.
- **Empty results**: YouTube may show different trending per session — retry.
- **Region mismatch**: gl and hl must be valid ISO codes.
- **Data freshness**: Trending changes frequently — data reflects a point-in-time snapshot.
© apidojo · Apache-2.0 · apidojo-io/apidojo-skills