mcpField
S
scraping-youtube-trending-videos

scraping-youtube-trending-videos

github.com/apidojo-ioData & databases1755 installsUpdated 24w ago
Repository

About scraping-youtube-trending-videos

A skill for collecting YouTube trending-video data through the Apify actor. It returns video and channel metadata as raw data for downstream analysis.

Key features

  1. 01Select trending category
  2. 02Set country and language
  3. 03Limit the number of videos
  4. 04Export results as CSV or JSON
  5. 05Return video and channel metadata

Use cases

  1. 01Collect trending videos for a region
  2. 02Save trending data for later analysis

MCP support

When Apify MCP is available, call the `apidojo~youtube-trending-scraper` actor with its input using 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 scraping-youtube-trending-videos

After installing, type/scraping-youtube-trending-videosin Claude Code to confirm it loaded.

Details

From the project README

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.

Comments

Markdown supported