Scrapers

YouTube trends

Pure InnerTube API access. No browser, no PoToken in v1. Tracks YouTube trending feeds per country, channel uploads, video metadata, search results, and Shorts. Writes one item per video or channel to the dataset.

Updated today

Overview

At a glance
Worker
ultron-youtube-trends
Runtime
youtubei.js (pure InnerTube), no browser
Modes
trending, channel, video, search, shorts
Default
trending feed for US
Cap
500 items per target. Hard ceiling 250k per run.
Proxy
Residential US default; tunable per country
Default delay
1500 ms per call, jittered 1 to 3 seconds

Picked when a workspace needs to observe what is rising on YouTube for a region, audit a channel's recent uploads, or backfill metadata for a known video id list. Most chat-driven calls land in trending or search mode; the marketing swarm uses channel mode to pull competitor uploads weekly.

Five modes

The mode knob selects which surface to scrape.

ModeInputsReturns
trendingregions[] (ISO 3166-1 alpha-2)One trending feed per country, max 50 items by default.
channelchannelIds[] (UC-prefixed)Recent uploads for each channel id.
videovideoIds[] (11-char id)Full metadata enrichment for known video ids.
searchsearchQueries[]Search result lists per query.
shortsregions[]Shorts trending feed per country.

Input schema

.actor/INPUT_SCHEMA.jsonjson
1{
2 "mode": "trending", // trending | channel | video | search | shorts
3 "regions": ["US"], // for trending and shorts
4 "channelIds": ["UCxxx..."], // for channel mode
5 "videoIds": ["dQw4w9WgXcQ"], // for video mode
6 "searchQueries": ["ai agents 2026"], // for search mode
7 "maxItemsPerTarget": 50, // 1 to 500
8 "client": "WEB", // WEB | ANDROID | IOS | ANDROID_VR | TV
9 "language": "en",
10 "proxyConfiguration": {
11 "useApifyProxy": true,
12 "apifyProxyGroups": ["RESIDENTIAL"],
13 "apifyProxyCountry": "US"
14 },
15 "requestDelayMs": 1500
16}
Tip
The client knob is the escape hatch. WEB carries the most metadata but is also the most aggressively gated. ANDROID and IOS return reduced fields but bypass the PoToken requirement entirely. ANDROID_VR is the most aggressive bypass when the others fail.

Crawl flow

Per-target loop with InnerTube under the hood.

src/__main__.pypy
1# 1. Instantiate youtubei.js Innertube with client + hl=language.
2# 2. For each target (region | channelId | videoId | query):
3# a. Call the appropriate InnerTube endpoint (Browse, Next, Search, Player).
4# b. Walk the continuation token until maxItemsPerTarget is reached.
5# c. Per item, normalise the response into the canonical dataset row.
6# d. Push to the default dataset.
7# 3. Sleep requestDelayMs + 1 to 3 s jitter between calls.
8# 4. Catch "Sign in to confirm" via the IS_BOT signal in responses;
9# log and surface in run output, but do not retry mid-run.

Output shape

One row per video or channel.

dataset-row.jsonjson
1{
2 "kind": "video", // video | channel
3 "source": "youtube",
4 "capturedFrom": "trending", // mode that produced this row
5 "videoId": "dQw4w9WgXcQ",
6 "channelId": "UCxxx...",
7 "title": "AI Agents in 2026 - The Year of Operators",
8 "channelName": "Nexity Labs",
9 "viewCount": 128431,
10 "likeCount": 8421,
11 "commentCount": 342,
12 "publishedAt": "2026-05-18T14:00:00Z",
13 "durationSec": 612,
14 "isShorts": false,
15 "thumbnails": ["https://i.ytimg.com/..."],
16 "scrapedAt": "2026-05-19T12:00:00Z"
17}

InnerTube clients

ClientFieldsWhen to use
WEBFull metadata, all fields populated.Default. First-line client.
ANDROIDMost fields, a few mobile-only.When WEB hits the bot gate. Slightly less metadata.
IOSSlimmer payload, fewer thumbnails.Second-line fallback.
ANDROID_VRBypass-focused, minimal metadata.Last resort when both WEB and ANDROID gate.
TVTV-specific metadata. Niche.Rarely useful.

Webhook contract

actor.jsonjson
1{
2 "eventTypes": ["ACTOR.RUN.SUCCEEDED", "ACTOR.RUN.FAILED", "ACTOR.RUN.TIMED_OUT", "ACTOR.RUN.ABORTED"],
3 "requestUrl": "https://scraper-webhook.51ultron.com/apify",
4 "payload": {
5 "actorName": "youtube-trends",
6 "source": "youtube",
7 "datasetId": "<id>"
8 }
9}

File map

actors/youtube-trends
.actor
actor.json
INPUT_SCHEMA.json
src
__main__.pyInnerTube wrapper + per-mode dispatchers
Dockerfile
requirements.txt
README.md