YouTube Trending Scraper REST API and Apify actor
YouTube's music charts, for any country.
Pick a country and a chart, get every entry with its rank, last rank, weeks on chart, artists and views. Straight from YouTube Charts.
0.50 USD per 1,000 chart entries. 5 USD free credits, no card. Credit packs.
curl -G "https://api.vakitek.co.uk/v1/youtube/trending" \ -H "X-API-Key: $VAKITEK_API_KEY" \ --data-urlencode "country=US" \ --data-urlencode "chart=top_videos_weekly" \ --data-urlencode "max_results=5"
import os, requests r = requests.get("https://api.vakitek.co.uk/v1/youtube/trending", headers={"X-API-Key": os.environ["VAKITEK_API_KEY"]}, params={"country": "US", "chart": "top_videos_weekly", "max_results": 5}, timeout=120) for row in r.json()["data"]: print(row["rank"], row["title"], row["viewCount"])
{
"rank": 1,
"previousRank": 3,
"weeksOnChart": 24,
"title": "Dai Dai",
"channelName": "shakiraVEVO",
"artists": ["Shakira", "Burna Boy"],
"viewCount": 2338755,
"viewCountChangePercent": -3.6,
"country": "US",
"chart": "top_videos_weekly",
...
}
What you get
Three official charts
trending (30 entries, rank only), top_videos_weekly and top_videos_daily (100 entries, with viewCount).
How each entry moved
rank, previousRank (null for a new entry), weeksOnChart and viewCountChangePercent versus last period.
Artists and channel
artists as a list, channelName, channelId, the video url and its releaseDate.
Clear failure rows
A country code that is not real, or not supported for this chart, returns a free INVALID_INPUT row.
Not included: a general list of trending videos: YouTube removed its Trending page in 2025, so these are its music charts. Limits and error codes.
Pay per chart entry
Video details at no extra cost on Apify. Error rows are free. No minimum per run, no monthly plan.
One wallet for all 10 YouTube APIs. Credits never expire. Credit packs from 10 USD. Runs on Apify are billed by Apify.
Questions
Is this every trending video on YouTube?
No. YouTube removed its general Trending page in 2025. These are its official music charts, the closest official source still published.
Why are view counts empty on some rows?
The trending chart carries a rank only. The two top videos charts always have viewCount.
Can I track a chart every day?
Yes. Call the API from your own scheduler, or schedule the Apify actor with your countries and chart.
Is it legal to scrape YouTube charts?
We read public YouTube pages only, with no login. YouTube's Terms of Service restrict automated access, so check your use against them and your local law.
Do I need Apify?
No. The REST API is separate: sign up with your email, copy your key, call it. Apify is the no-code option, billed by Apify on your Apify account at the same unit price plus its 0.00005 USD start event per run.
Pull your first chart in a minute.
API reference: endpoints, limits and error codes
Base URL https://api.vakitek.co.uk. Send your key in the X-API-Key header. Every response is JSON with data (one row per item), meta (request id, count, latency, paging cursor) and billing (what was charged).
GET /v1/youtube/trending
One country and one chart per call. One row per chart entry.
country | ISO code (US, FR, JP) or global | default US |
chart | trending, top_videos_weekly or top_videos_daily | default trending |
max_results | Chart entries to return | 1 to 100, default 100 |
global works for the two top videos charts only. Several countries per run, video details (likes, comment count, publish date, description) and schedules are on the Apify actor.
Limits
- Rate limit
- 120 requests per minute per API key (default). Over that you get 429. Need more? Write to support.
- Batch
- Transcript and Channel email take up to 25 videos or channels per
POST. More returns 422. - Page size
- Search up to 100 rows, Shorts and channel videos up to 200 rows per call, then follow
meta.next_cursor. - Concurrency
- No per-key cap. The service runs a limited number of scrapes at the same time and queues the rest, so very parallel clients wait longer. Start with 4 calls in flight.
- Latency
- 1 to 9 seconds per call in our checks on 23 Oct 2026 (one call per endpoint). Set your client timeout to 120 seconds.
- Wallet
- Checked before each call. When it is empty you get 402 and nothing runs. Runs on Apify are billed by Apify, not from this wallet.
- Data
- We keep request metadata (route, status, counts, timing) for billing and support. We do not keep a copy of the rows we return.
HTTP status codes
| Status | Body | Meaning | What to do |
|---|---|---|---|
| 200 | {data, meta, billing} | Done. Some rows may carry an error code (free). | Retry only rows whose code says retry later. |
| 401 | UNAUTHORIZED | Missing or wrong X-API-Key. | Fix the key. Do not retry. |
| 402 | INSUFFICIENT_CREDITS | Your wallet is empty. | Buy a pack, then retry. |
| 422 | INVALID_INPUT | A parameter is wrong, or more than 25 items in a batch. | Fix the request. Do not retry. |
| 429 | RATE_LIMITED | Over 120 requests per minute. | Wait, then retry with backoff: 1 s, 2 s, 4 s. |
| 502 | UPSTREAM_ERROR | YouTube or our service failed for the whole call. Not billed. | Retry once after a few seconds. |
| Row code | What happened | Retry | You pay |
|---|---|---|---|
chart entry | A chart entry came back. The only billed row. | n/a | 0.50 USD / 1,000 |
| INVALID_INPUT | The country code is not a real country, or not supported for this chart | no retry | free |
| NO_RESULTS | The chart came back empty for this country | no retry | free |
| PARSE_ERROR | YouTube changed its page and we could not read it. We get alerted and fix it | no retry | free |
| BLOCKED | YouTube refused us for now, even after trying every proxy tier | retry later | free |
| UPSTREAM_ERROR | Something went wrong on YouTube's side or ours | retry later | free |
| UPSTREAM_UNAVAILABLE | Our API was unreachable | retry later | free |
| TIME_BUDGET_EXCEEDED | The time budget ran out before this country finished | retry later | free |
