Introducing the Instagram APIRead more →

YouTube Trending Videos API. Trending videos, on request.

Trending and top music videos by country. We handle the proxies, blocks and platform changes.

In your agent: YouTube MCP server →

YouTube Trending Videos API at a glance

Returns a country's YouTube music charts, top first: Trending 20 and the daily and weekly top music videos. Some countries also chart live performances, genres or languages. Each video has its rank, title, channel, views, upload time and length, and the top 15 also have exact view and like counts and their description.

GET /v1/youtube/top_posts

Read the API reference
  • 1 credit per page, $0.75–$1.97 per 1,000 pages
  • 25 typed fields null when unknown
  • 100 trending and top music videos per page, the chart's rank (1 = top)
  • 100 credits free when you sign up, no card, so you can build before you spend

Send one request. Get up to 100 trending and top music videos back.

Copy the request in your language, or hand it to your agent. Sign up for an API key and your first 100 credits are free.

$ npm install socialtap
GET /v1/youtube/top_postsTry in
// Node 18+: save this as app.mjs (an ES module) and run: node app.mjs
const params = new URLSearchParams({
  chart: "trending",
  country: "US",
});
const res = await fetch(`https://socialtap.dev/v1/youtube/top_posts?${params}`, {
  headers: { "x-api-key": process.env.SOCIALTAP_API_KEY ?? "" },
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
const { data, page, meta } = body;
console.log(data, meta.credits_charged);
200 OK · GET https://socialtap.dev/v1/youtube/top_postsLong arrays and strings are shortened here. Real responses are complete.Docs

One schema on 24 platforms.

The response reference lists every field, its type and when it is null. See the full schema.

  • Null means unknown

    A field YouTube doesn't show is null, never zero or an empty string, so a real zero always means zero.

  • No input needed

    Every parameter is optional: the plain request returns the default list.

  • Write one parser

    YouTube, TikTok, Instagram and 21 more platforms answer in these fields, so the code that reads one reads them all.

platformstring
Platform ID (tiktok, youtube, …).
In the example "youtube"
idstring
Platform-native post ID (string; Instagram shortcode, Reddit with its t3_ prefix).
In the example "1lOvAvBlzSM"
urlstring
Canonical post URL.
In the example "https://www.youtube.com/watch?v=1lOvAvBlzSM"
typestring
Normalized content shape. New values may be added; treat unknown values as other.
In the example "video"
platform_typestring
The platform's own product label, lowercase (reel, short, story, live, tweet, …).
In the example "video"
titlestring
Headline (YouTube title, Reddit title); null on caption-only platforms.
In the example "Anuel AA | SE TOCO EL T*TITO CON MI GL*CK (Video Oficial)"
textstring
Caption, description or body as plain text.
In the example "Anuel AA | SE TOCO EL T*TITO CON MI GL*CK (Video Oficial) ⚊⚊⚊⚊⚊⚊✰⛤✰⚊⚊⚊⚊…"
link_urlstring
The page the post links to: a link post's target, a pin's destination, or the page its link card or link sticker opens; null when it links to none.
In the example null

What teams build with the YouTube Trending Videos API.

  • Track the hottest songs on YouTube each day

    Read the trending chart every morning and store each video's rank and view_count, to see which songs climb and how long they stay.

  • Compare what plays in Brazil and India

    Read the daily chart with country BR, then IN, and compare the artists and songs each country's chart ranks highest.

  • Watch a genre's weekly chart

    Read the pop or latin chart each week to list the songs entering the top 50, with their channel and upload time.

  • Find new releases breaking into the charts

    Set since to the start of the month to keep only videos uploaded since then, and see which new releases reached a country's weekly chart.

Good to know before you build.

  • YouTube retired its Trending page and publishes charts of music videos only: no logged-out chart ranks gaming, sports or news videos.
  • The top 15 videos of a chart have exact views, likes, upload times and descriptions. The rest show rounded views and upload dates, listed in approximate_fields.
  • A chart lists up to 20 trending, 100 daily or weekly, or 50 genre videos, and a smaller country's chart can list fewer. Every chart ends at platform_limit.
  • Rank is the video's place on the chart, counting videos YouTube doesn't play in some regions. When an answer can't see them, rank is null and the order still holds.
  • The genre charts are the United States', the language charts India's, and the global charts (ZZ) have no trending chart.

1 credit per page. Failed requests are free.

Buy credits once and spend them on any endpoint, on any platform.

SourcePrice per successful pagePer 1,000 pages
Any source1 credit$0.75–$1.97
  • Cache hits are free.
  • Credits from packs and top-ups never expire.
  • A monthly plan's credits are spent first, and what is left of them ends at each renewal.
  • Prices exclude tax: sales tax is added at checkout where it applies.
  • Outside the US, plans and packs are sold to businesses: checkout asks for your VAT, GST or other business tax ID.

Questions about the YouTube Trending Videos API.

More in the API reference.

Is this YouTube's Trending page?
No. YouTube retired its Trending page; this reads YouTube Charts, the music charts YouTube Music publishes for each country. Its trending chart is Trending 20, today's hottest songs on YouTube.
Which countries have charts?
The countries YouTube Music's charts menu offers, about seventy, and ZZ for the global charts. Another country returns invalid_input naming every country the menu offers.
Are the view counts exact?
Yes for a chart's top 15, with their likes. Below them views are rounded, as YouTube shows them: send a video's link to the YouTube Video API for its exact numbers.
How much does the YouTube Trending Videos API cost?
A page of up to 100 trending and top music videos costs 1 credit. Every successful page is charged, empty pages included. SocialTap credits cost $0.75–$1.97 per 1,000, depending on the plan or pack.
How do I get the next page?
Repeat the same request with cursor set to page.next_cursor from the previous response, keeping the other parameters. When page.has_more is false there are no more pages. Cursors expire after 24 hours.

See what's on the list right now.

Run it in the playground, or copy the request into your code.

100free credits
  • No credit card
  • Failed requests are free
  • Works on all 310 endpoints
Start for free Read the docs