YouTube channel videos API
A channel’s videos, latest, popular or oldest first, 30 a page; details=true adds exact counts and publish times to every row.
GET /v1/youtube/channels/{channel}/videosBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/youtube/channels/@mkbhd/videos?sort=popular",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "kind": "youtube#videoListResponse", "items": [ { "kind": "youtube#video", "id": "cc5C8hRblBY", "snippet": { "publishedTimeText": "1 day ago", "publishedAt": "2026-11-23T12:00:00.000Z", "publishedAtIsApproximate": true, "channelId": "UCBJycsmduvYEL83R_U4JriQ", "channelTitle": "Marques Brownlee", "title": "I'm Starting Over", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/cc5C8hRblBY/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/cc5C8hRblBY/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/cc5C8hRblBY/hqdefault.jpg", "width": 480, "height": 360 }, "standard": { "url": "https://i.ytimg.com/vi/cc5C8hRblBY/sddefault.jpg", "width": 640, "height": 480 } }, "liveBroadcastContent": "none" }, "channel": { "id": "UCBJycsmduvYEL83R_U4JriQ", "title": "Marques Brownlee", "handle": "@mkbhd", "url": "https://www.youtube.com/@mkbhd" }, "statistics": { "viewCount": "3700000" }, "statisticsAreApproximate": true, "contentDetails": { "duration": "PT21M36S", "durationSeconds": 1296 } }, { "kind": "youtube#video", "id": "KTDJiVpSDTI", "snippet": { "publishedTimeText": "7 days ago", "publishedAt": "2026-11-17T12:00:00.000Z", "publishedAtIsApproximate": true, "channelId": "UCBJycsmduvYEL83R_U4JriQ", "channelTitle": "Marques Brownlee", "title": "Can You Trust MKBHD?", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/KTDJiVpSDTI/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/KTDJiVpSDTI/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/KTDJiVpSDTI/hqdefault.jpg", "width": 480, "height": 360 }, "standard": { "url": "https://i.ytimg.com/vi/KTDJiVpSDTI/sddefault.jpg", "width": 640, "height": 480 } }, "liveBroadcastContent": "none" }, "channel": { "id": "UCBJycsmduvYEL83R_U4JriQ", "title": "Marques Brownlee", "handle": "@mkbhd", "url": "https://www.youtube.com/@mkbhd" }, "statistics": { "viewCount": "3900000" }, "statisticsAreApproximate": true, "contentDetails": { "duration": "PT14M19S", "durationSeconds": 859 } }, "… 1 more" ], "pageInfo": { "resultsPerPage": 6 }}Parameters
| Name | Type | Description |
|---|---|---|
channelpath · required | string | A channel id (UC…), a handle with or without the @, or any channel URL (/@handle, /channel/UC…, /c/name, /user/name). Example: @MrBeast. |
sortquery | "latest" | "popular" | "oldest" | latest (default), popular or oldest. One of latest, popular, oldest. |
detailsquery | "0" | "1" | "true" | "false" | true: exact counts and dates for every row. One of 0, 1, true, false. |
afterquery | string | The previous page’s nextPageToken. Tokens last 6 hours. |
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 | A page of 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
Are dates exact?
List rows show “3 days ago”, so publishedAt is estimated and flagged publishedAtIsApproximate; details=true gives exact times.
YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.