YouTube trending videos API
The videos on YouTube’s trending shelves for music, sports, news or gaming (YouTube retired the Trending page in 2025).
GET /v1/youtube/trending/videosBeta2 credits per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/youtube/trending/videos?category=music",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 2 credits{ "kind": "youtube#videoListResponse", "items": [ { "kind": "youtube#video", "id": "UyNgewSEJBo", "snippet": { "publishedTimeText": "3 months ago", "publishedAt": "2026-08-26T12:00:00.000Z", "publishedAtIsApproximate": true, "channelId": "UCRies0g4PwzR8wn4VMJCTNw", "channelTitle": "mthu", "title": "mthu - it's like i'm not even here (Official Music Video)", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" }, "standard": { "…": "3 fields" } }, "liveBroadcastContent": "none" }, "channel": { "id": "UCRies0g4PwzR8wn4VMJCTNw", "title": "mthu", "handle": "@mthuonspotify", "url": "https://www.youtube.com/@mthuonspotify", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" } } }, "statistics": { "viewCount": "728000" }, "statisticsAreApproximate": true, "contentDetails": { "duration": "PT1M40S", "durationSeconds": 100 } }, { "kind": "youtube#video", "id": "2Tp9lBaj7W8", "snippet": { "publishedTimeText": "1 month ago", "publishedAt": "2026-10-25T12:00:00.000Z", "publishedAtIsApproximate": true, "channelId": "UCrigz9aEMzT3JwTOeIvCb-A", "channelTitle": "Say Now", "title": "Say Now - Hot & talking (Official Music Video)", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" }, "standard": { "…": "3 fields" } }, "liveBroadcastContent": "none" }, "channel": { "id": "UCrigz9aEMzT3JwTOeIvCb-A", "title": "Say Now", "url": "https://www.youtube.com/channel/UCrigz9aEMzT3JwTOeIvCb-A", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" } } }, "statistics": { "viewCount": "1800000" }, "statisticsAreApproximate": true, "contentDetails": { "duration": "PT3M23S", "durationSeconds": 203 } }, "… 1 more" ], "pageInfo": { "resultsPerPage": 7 }}Parameters
| Name | Type | Description |
|---|---|---|
categoryquery | "music" | "sports" | "news" | "gaming" | One of music, sports, news, gaming. |
regionquery | string | ISO 3166-1 alpha-2 country: the results a visitor there sees. Example: US. |
Response fields
200 with a YouTubeVideoList, in the shape of YouTube Data API v3 resources.
| Field | Type | Description |
|---|---|---|
kind | "youtube#videoListResponse" | |
items | YouTubeVideo[] | |
nextPageToken | string | Pass as after for the next page. Absent on the last page. Lasts 6 hours. |
pageInfo | object | |
missing | object[] | Batch only: requested ids that did not resolve, and why. |
Status codes
| Status | Meaning |
|---|---|
200 | The trending shelf’s videos. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | The video, channel, playlist or post does not exist, was removed, or has nothing there. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | YouTube is temporarily unavailable. Retryable; nothing was charged. |
Every error has code, message, hint and retryable. All error codes
Questions
Why no general trending list?
YouTube removed it; the topic pages’ trending shelves are what a visitor sees now.
YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.