scraping-youtube-trending-videos

v2026.09.24

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.

GitHub
Install command
npx skhub add apidojo-io/scraping-youtube-trending-videos
Markdown
SKILL.md

Scraping Youtube Trending Videos

Raw data collection. No assumed use case — returns the full dataset for downstream analysis.


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.


Output Fields

FieldTypeDescription
typestringAlways video
idstringVideo ID
titlestringVideo title
urlstringVideo URL
descriptionstringVideo description
durationnumberDuration in seconds
viewsnumberView count
likesnumberLike count
statusstringAvailability status
channel.idstringChannel ID
channel.namestringChannel name
channel.urlstringChannel URL
keywordsarrayVideo tags/keywords
isLivebooleanLive stream flag
thumbnailsarrayThumbnail 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.
Discovery
Tags

No tags published for this skill.

Version
Latest version metadata

Version

v2026.09.24

Published

Sep 24, 2026

Category

Uncategorized

License

Apache-2.0

Source path

skills/primitives/scraping-youtube-trending-videos

Default branch

main

Latest commit

ffbdc00

Tree SHA

c7df562