Skip to main content
skill CX Codex

discovering-viral-youtube-videos-by-category — Claude Code skill

Fetch trending YouTube videos across categories and countries using an Apify scraper. It pulls views, likes, channel details, and tags into your AI workspace.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add apidojo-io/apidojo-skills --skill discovering-viral-youtube-videos-by-category -a claude-code
Open on GitHub

What discovering-viral-youtube-videos-by-category does

The skill connects to the apidojo~youtube-trending-scraper actor on Apify. Execution runs via scripts/run_actor.js, the Apify MCP call_actor tool, or the Apify REST API. The scraper returns video titles, view counts, like counts, durations, keywords, and thumbnail links.

Queries support filtering by ISO country code gl, language hl, and category type. Categories include default trending, gaming, music, and movies. Live streams include the isLive=true property. Filter them out if you only need recorded videos.

Direct REST requests require a valid $APIFY_TOKEN. Some regions lack dedicated category tabs, which forces a fallback to the default trending feed.

What it helps with

  • Find today's viral YouTube videos for a specific country
  • Inspect trending gaming or music uploads
  • Gather high-performing keywords and titles for content research
  • Export trending video metrics to JSON or CSV files

Example prompts for the agent

  • "Find viral YouTube videos today in the US gaming category"
  • "Get trending YouTube music videos in Great Britain and save them to results.json"
  • "Research top YouTube videos this week in Germany to see which topics dominate"

How to install discovering-viral-youtube-videos-by-category

1Skills CLI (Vercel)

npx skills add apidojo-io/apidojo-skills --skill discovering-viral-youtube-videos-by-category -a claude-code

2Manually: put the files in place

~/.claude/skills/discovering-viral-youtube-videos-by-category/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/discovering-viral-youtube-videos-by-category/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about discovering-viral-youtube-videos-by-category

How to install discovering-viral-youtube-videos-by-category in Claude Code?

Run npx skills add apidojo-io/apidojo-skills --skill discovering-viral-youtube-videos-by-category -a claude-code in your terminal. The configuration is stored in ~/.claude/skills/discovering-viral-youtube-videos-by-category/SKILL.md.

What does discovering-viral-youtube-videos-by-category do?

It triggers an Apify actor to retrieve trending YouTube content filtered by topic, country code, and language.

What credentials do I need to run this skill?

You need an Apify account setup, either through an Apify MCP integration or an $APIFY_TOKEN environment variable for REST requests.

Source text

SKILL.md · Apache-2.0
---
name: discovering-viral-youtube-videos-by-category
description: >
  Discovers trending and viral YouTube videos by category and country using apidojo's YouTube
  Trending Scraper on Apify. Triggers when the user asks to: find viral YouTube videos today, discover
  what's trending on YouTube in a specific country, get trending gaming or music videos on YouTube,
  find top YouTube videos this week by category, identify viral content on YouTube for inspiration,
  research what topics are dominating YouTube trending, or track trending YouTube content for content
  strategy. Returns video title, views, likes, channel info, duration, keywords, and thumbnail.
  Ideal for content strategists, YouTubers, and trend researchers.
license: Apache-2.0
metadata:
  author: apidojo
  version: "1.0"
  apify-actor: apidojo/youtube-trending-scraper
---

# Discovering Viral Youtube Videos By Category

---

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

---

## Scoring & Ranking

Score each video by:
- `views` → normalized 0-1 (cap at 10M), weight 0.40
- `likes` → normalized 0-1 (cap at 500K), weight 0.35
- `recency` (trending = 1.0 by definition), weight 0.25

```python
score = 0.40 * min(views / 10000000, 1.0) + 0.35 * min(likes / 500000, 1.0) + 0.25
```

---

## Classification

| Score | Tier | Label |
|-------|------|-------|
| ≥ 0.70 | A | MEGA_VIRAL |
| 0.40–0.69 | B | TRENDING |
| < 0.40 | C | RISING |

---

## Edge Cases

- **Category not available for country**: Some countries only have `n` (all). Fall back to `type=n`.
- **Stale data**: Trending changes throughout the day — data is a snapshot.
- **Music/movies category**: Returns full songs or trailers — content type differs from regular videos.
- **Livestreams in results**: isLive=true items are ongoing streams — filter if you need VOD only.
- **Country mismatch**: gl must be a valid ISO country code (e.g., `us`, `gb`, `de`).

© apidojo · Apache-2.0 · apidojo-io/apidojo-skills

Similar skills

Everything for Marketing and content →

From the same set82

scraping-tiktok-profile-data Pulls TikTok profile stats and metadata for a batch of accounts: followers, following, total likes, video count, bio. Handy when you need to vet a creator list. CX Codex +1 834installs finding-instagram-creators-by-location Finds Instagram creators who post from a given city, venue or neighborhood. Useful for geo-targeted campaigns and regional partnerships. CX Codex +1 833installs finding-healthcare-practices-via-google-search Searches Google for clinics, dental offices, and other healthcare providers. Use it to build a location- or specialty-based prospect list. CX Codex +1 816installs tracking-youtube-trending-topics-by-niche This skill finds current YouTube trends within a niche and reports video formats, themes, views, and engagement. Use it to shape video research and ideas. CX Codex +1 813installs finding-tiktok-creators-using-trending-sounds Pulls TikTok posts made to a given track and returns the accounts behind them. Useful when you need a creator list for a brand placement. CX Codex +1 813installs building-full-social-audit-for-brand Audits brand profiles across Twitter, Instagram, TikTok, and YouTube via Apify scrapers. Computes engagement metrics and an aggregate brand health score. CX Codex +1 813installs scraping-instagram-location-content Pulls public Instagram posts tagged at one place and returns post URLs, captions, handles, likes and dates. Useful when you want to see what visitors post about a venue. CX Codex +1 810installs scraping-instagram-profile-data Collect Instagram profile stats and recent post metrics through an Apify scraper. Use it to check a set of accounts or export profile details. CX Codex +1 806installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor