mcpField
D
discovering-viral-youtube-videos-by-category

discovering-viral-youtube-videos-by-category

github.com/apidojo-ioMarketing & growth1887 installsUpdated 24w ago
Repository

About discovering-viral-youtube-videos-by-category

discovering-viral-youtube-videos-by-category is a skill for retrieving YouTube trending videos by category and region, intended for video trend analysis. It can fetch results through an Apify Actor and provides rules for scoring and tiering videos by views, likes, and recency.

Key features

  1. 01Filter videos by trending category and country
  2. 02Set language and maximum result count
  3. 03Save results as CSV or JSON
  4. 04Score by views, likes, and recency
  5. 05Assign videos to trend tiers

Use cases

  1. 01Retrieve YouTube trending videos for a country
  2. 02Compare music, movie, or gaming categories
  3. 03Export trend results for later analysis
  4. 04Filter popular or emerging videos by score

MCP support

The README says that when Apify MCP is available, the apidojo~youtube-trending-scraper Actor can be called with the call_actor tool.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/apidojo-io/apidojo-skills --skill discovering-viral-youtube-videos-by-category

After installing, type/discovering-viral-youtube-videos-by-categoryin Claude Code to confirm it loaded.

Details

From the project README

Discovering Viral Youtube Videos By Category


Inputs

ParameterTypeRequiredDefaultNotes
typestringOptionalnTrending category: n (now), music, movies, gaming
glstringOptionalusCountry code (e.g. US, GB)
hlstringOptionalenLanguage code (e.g. en)
maxItemsnumberOptionalUnlimitedMaximum videos to return
customMapFunctionstringOptional—JavaScript function to transform each output object

How to Run

Using run_actor.js (recommended)
# 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
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
score = 0.40 * min(views / 10000000, 1.0) + 0.35 * min(likes / 500000, 1.0) + 0.25

Classification

ScoreTierLabel
≥ 0.70AMEGA_VIRAL
0.40–0.69BTRENDING
< 0.40CRISING

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

Comments

Markdown supported