YouTube Trending Scraper avatar

YouTube Trending Scraper

Pricing

from $0.01 / 1,000 results

Go to Apify Store
YouTube Trending Scraper

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

Assia Fadli

Maintained by Community

Actor 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:

FieldDescription
categoryTrending category (now, music, gaming, movies)
sourceWhich source produced the row — see How it works
rank1-based position in the trending list
videoId11-character video ID
titleVideo title
urlhttps://www.youtube.com/watch?v=<videoId>
channelNameChannel display name
channelIdThe channel's UC… ID (when available)
channelUrlhttps://www.youtube.com/channel/<channelId> (when available)
viewsTextView count as YouTube's own display text, e.g. "15,780,087 views"
viewCountBest-effort integer parse of viewsText, e.g. 15780087
publishedTextRelative publish time, e.g. "5 days ago"
lengthTextDuration, e.g. "3:25"
descriptionSnippetShort description snippet (when available)
thumbnailHighest-resolution thumbnail URL
thumbnailsFull 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

FieldTypeRequiredDefaultDescription
categorystringnonownow (general), music, gaming, or movies
maxResultsintegerno50Maximum number of trending videos to return
glstringnoUSISO country code for the trending region (e.g. US, GB, DE, IN)
countrystringnoAlias for gl; gl wins if both are set
languagestringnoenISO language code for titles / metadata
proxyCountryCodestringnoUSISO 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:

  1. Legacy Trending feed (forward-compatibility). It first POSTs to youtubei/v1/browse with browseId: "FEtrending" (and the classic category params) using the WEB client. If YouTube ever restores this feed, the actor picks it up automatically and rows are tagged source: "trending".
  2. Most-viewed-this-week search (the working source today). When the legacy feed is unavailable, it POSTs to youtubei/v1/search with the ANDROID client, sorting by view count and restricting to videos uploaded this week (search filter params: "CAMSBAgDEAE="). A broad seed query per category (now uses 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 until maxResults is reached, de-duplicating by videoId and guarding against continuation loops. These rows are tagged source: "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, publishedText and lengthText are YouTube's own localized display text; viewCount is a best-effort numeric parse of viewsText.
  • The region is controlled by gl / country; for the most accurate regional results, set proxyCountryCode to 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