YouTube Trending Scraper
Pricing
from $0.01 / 1,000 results
YouTube Trending Scraper
Grab what's blowing up on YouTube right now — one clean row per trending video for any country and category (id, title, channel, view count, published time, duration, thumbnails). Talks straight to YouTube's own InnerTube API, so there's no Data API key and no headless browser.
Pricing
from $0.01 / 1,000 results
Rating
0.0
(0)
Developer
Assia Fadli
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
6 days ago
Last modified
Categories
Share
See exactly what's taking off on YouTube right now. Pick a category and a country and this actor hands you one tidy row per trending video — no YouTube Data API key, no headless browser, no login required.
Under the hood it speaks directly to YouTube's own internal InnerTube API (the very endpoints the YouTube app and website call), which keeps every run fast, cheap and dependable.
What you get
One dataset row per trending video:
| Field | Description |
|---|---|
category | Trending category (now, music, gaming, movies) |
source | Which source produced the row — see How it works |
rank | 1-based position in the trending list |
videoId | 11-character video ID |
title | Video title |
url | https://www.youtube.com/watch?v=<videoId> |
channelName | Channel display name |
channelId | The channel's UC… ID (when available) |
channelUrl | https://www.youtube.com/channel/<channelId> (when available) |
viewsText | View count as YouTube's own display text, e.g. "15,780,087 views" |
viewCount | Best-effort integer parse of viewsText, e.g. 15780087 |
publishedText | Relative publish time, e.g. "5 days ago" |
lengthText | Duration, e.g. "3:25" |
descriptionSnippet | Short description snippet (when available) |
thumbnail | Highest-resolution thumbnail URL |
thumbnails | Full array of { url, width, height } thumbnails |
If nothing can be fetched for the requested region, the actor still writes a single row —
{ "category": "…", "region": "…", "error": "…" } — so a run is never silently empty.
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
category | string | no | now | now (general), music, gaming, or movies |
maxResults | integer | no | 50 | Maximum number of trending videos to return |
gl | string | no | US | ISO country code for the trending region (e.g. US, GB, DE, IN) |
country | string | no | — | Alias for gl; gl wins if both are set |
language | string | no | en | ISO language code for titles / metadata |
proxyCountryCode | string | no | US | ISO country code for the Apify residential proxy exit |
Example input
{"category": "now","maxResults": 50,"gl": "US","proxyCountryCode": "US"}
Example output row
{"category": "now","source": "most_viewed_this_week","rank": 1,"videoId": "qFhspt7zsXg","title": "Number_i - BUGS LIFE (Official Music Video)","url": "https://www.youtube.com/watch?v=qFhspt7zsXg","channelName": "Number_i OFFICIAL","channelId": "UC7N348fUF5Sh-N4m1y578zg","channelUrl": "https://www.youtube.com/channel/UC7N348fUF5Sh-N4m1y578zg","viewsText": "15,780,087 views","viewCount": 15780087,"publishedText": "5 days ago","lengthText": "3:25","thumbnail": "https://i.ytimg.com/vi/qFhspt7zsXg/hqdefault.jpg"}
How it works
YouTube retired its dedicated Trending feed (browseId: "FEtrending") in 2025: every InnerTube
client now returns HTTP 400 for it, /feed/trending redirects to the (empty, logged-out) home feed,
and the feed no longer appears in the navigation guide. To keep returning a real, up-to-date trending
list, this actor uses a resilient two-step strategy:
- Legacy Trending feed (forward-compatibility). It first POSTs to
youtubei/v1/browsewithbrowseId: "FEtrending"(and the classic categoryparams) using the WEB client. If YouTube ever restores this feed, the actor picks it up automatically and rows are taggedsource: "trending". - Most-viewed-this-week search (the working source today). When the legacy feed is unavailable,
it POSTs to
youtubei/v1/searchwith the ANDROID client, sorting by view count and restricting to videos uploaded this week (search filterparams: "CAMSBAgDEAE="). A broad seed query per category (nowuses a ubiquitous stop-word so the result reflects the week's overall most-viewed videos across every category) surfaces what is currently blowing up. It pages through continuation tokens untilmaxResultsis reached, de-duplicating byvideoIdand guarding against continuation loops. These rows are taggedsource: "most_viewed_this_week".
Requests are routed through Apify residential proxy when available, with an automatic fallback to a direct connection so a blocked or absent proxy never crashes the run.
Pricing
This actor uses Apify's pay-per-event model. You're charged once per trending video delivered to
the dataset (video-scraped). Error rows are never billed, and the run stops automatically the
moment your budget is reached.
Notes & limitations
- Because YouTube removed the official Trending feed, "trending" is currently derived from the most-viewed videos uploaded in the last week for the chosen category and region. This closely tracks what people are watching now, but it is not identical to the old editorially-curated Trending page.
viewsText,publishedTextandlengthTextare YouTube's own localized display text;viewCountis a best-effort numeric parse ofviewsText.- The region is controlled by
gl/country; for the most accurate regional results, setproxyCountryCodeto the same country. - YouTube can change its internal API at any time; this actor tolerates several response shapes but is not covered by an official API contract.
Tech
Written in TypeScript on the Apify SDK, using got-scraping for the InnerTube requests.
HTTP-only, so builds are fast and runs are cheap.
License
MIT © Assia Fadli