Fetch “most-popular” videos for any country or category in real-time.
Pull the official “Most-Popular” list straight from YouTube.
Specify any ISO-3166 country code (US, GB, IN…).
Narrow down to Music (10), Gaming (20) & more, max 50 results.
POST https://api.yeb.to/v1/youtube/trending
Parameter | Type | Req. | Description |
---|---|---|---|
api_key |
string | yes | Your API key |
country |
string | opt | ISO-3166 code (default US) |
category |
int | opt | YouTube category ID (e.g. 10 = Music) |
limit |
int | opt | 1-50 results (default 20) |
curl -X POST https://api.yeb.to/v1/youtube/trending \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_KEY",
"country": "GB",
"category": "10",
"limit": 25
}'
{
"data": {
"country": "GB",
"category": "10",
"cnt_results": 1,
"videos": [
{
"id": "abc123XYZ",
"title": "Top UK Hit 2025",
"description": "Official video…",
"channelId": "UCmusic",
"channelTitle": "HitsNow",
"publishedAt": "2025-07-06T17:01:02Z",
"categoryId": "10",
"durationISO": "PT3M12S",
"viewCount": 4500000,
"likeCount": 128000,
"commentCount": 9800,
"thumb": "https://i.ytimg.com/vi/abc123XYZ/hqdefault.jpg"
}
]
}
}
{"error":"Invalid country code. Use ISO 3166-1 alpha-2 format.","code":400}
Code | Description |
---|---|
200 Success | Request processed OK. |
400 Bad Request | Input validation failed. |
401 Unauthorized | Missing / wrong API key. |
403 Forbidden | Key inactive or not allowed. |
429 Rate Limit | Too many requests. |
500 Server Error | Unexpected failure. |