discovering-viral-youtube-videos-by-category
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDiscovering Viral Youtube Videos By Category
按类别发现YouTube爆火视频
Inputs
输入参数
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
| string | Optional | | Trending category: |
| string | Optional | | Country code (e.g. |
| string | Optional | | Language code (e.g. |
| number | Optional | Unlimited | Maximum videos to return |
| string | Optional | — | JavaScript function to transform each output object |
| 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|
| string | 可选 | | 热门类别: |
| string | 可选 | | 国家代码(例如 |
| string | 可选 | | 语言代码(例如 |
| number | 可选 | 无限制 | 返回的最大视频数量 |
| string | 可选 | — | 用于转换每个输出对象的JavaScript函数 |
How to Run
运行方式
Using run_actor.js (recommended)
使用run_actor.js(推荐)
bash
undefinedbash
undefinedQuick answer (table)
快速输出(表格形式)
node scripts/run_actor.js --actor "apidojo~youtube-trending-scraper" --input '{"type": "n", "gl": "us", "hl": "en", "maxItems": 50}'
node scripts/run_actor.js --actor "apidojo~youtube-trending-scraper" --input '{"type": "n", "gl": "us", "hl": "en", "maxItems": 50}'
Save as CSV
保存为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
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
保存为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
undefinednode scripts/run_actor.js --actor "apidojo~youtube-trending-scraper" --input '{"type": "n", "gl": "us", "hl": "en", "maxItems": 50}' --output results.json --format json
undefinedREST API fallback
备用REST API方式
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 tool with actor and the input above.
call_actorapidojo~youtube-trending-scraperbash
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}'如果Apify MCP可用:
使用Apify MCP的工具,指定actor为并传入上述输入参数。
call_actorapidojo~youtube-trending-scraperScoring & Ranking
评分与排名
Score each video by:
- → normalized 0-1 (cap at 10M), weight 0.40
views - → normalized 0-1 (cap at 500K), weight 0.35
likes - (trending = 1.0 by definition), weight 0.25
recency
python
score = 0.40 * min(views / 10000000, 1.0) + 0.35 * min(likes / 500000, 1.0) + 0.25按以下标准为每个视频评分:
- (播放量)→ 归一化至0-1(上限1000万),权重0.40
views - (点赞数)→ 归一化至0-1(上限50万),权重0.35
likes - (时效性,热门内容默认值为1.0),权重0.25
recency
python
score = 0.40 * min(views / 10000000, 1.0) + 0.35 * min(likes / 500000, 1.0) + 0.25Classification
分类等级
| Score | Tier | Label |
|---|---|---|
| ≥ 0.70 | A | MEGA_VIRAL |
| 0.40–0.69 | B | TRENDING |
| < 0.40 | C | RISING |
| 评分 | 等级 | 标签 |
|---|---|---|
| ≥ 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 (all). Fall back to
n.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
- 国家无对应类别:部分国家仅支持(全部)类别,此时自动 fallback 到
n。type=n - 数据过时:热门内容全天动态变化,获取的数据仅为当前快照。
- 音乐/电影类别:返回完整歌曲或预告片,内容类型与常规视频不同。
- 结果包含直播:标记为isLive=true的条目是正在进行的直播,若仅需点播视频可进行过滤。
- 国家代码不匹配:gl必须为有效的ISO国家代码(例如、
us、gb)。de