YouTube bulk channels API
Up to 25 YouTube channels by id in one call, for five credits.
POST /v1/youtube/channels/batchBeta5 credits per callRefunded on failureimport os, requests
res = requests.post(
"https://api.groundsocial.dev/v1/youtube/channels/batch",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
json={"ids":["UCX6OQ3DkcsbYNE6H8uQQuVA","UCBJycsmduvYEL83R_U4JriQ"]},
)
res.raise_for_status()
data = res.json()Response
200 · 5 credits{ "kind": "youtube#channelListResponse", "items": [ { "kind": "youtube#channel", "id": "UCX6OQ3DkcsbYNE6H8uQQuVA", "snippet": { "title": "MrBeast", "description": "SUBSCRIBE FOR A COOKIE!\nNew MrBeast or MrBeast Gaming video every single Saturday at noon …", "customUrl": "@mrbeast", "handle": "@MrBeast", "publishedAt": "2012-02-19T00:00:00.000Z", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" } }, "country": "United States" }, "statistics": { "viewCount": "148078238266", "subscriberCount": "528000000", "hiddenSubscriberCount": false, "videoCount": "1017" }, "brandingSettings": { "channel": { "keywords": "mrbeast6000 beast mrbeast Mr.Beast mr" }, "image": { "bannerExternalUrl": "https://yt3.googleusercontent.com/mHMO_eEMp0dPvh0ADwXhPXNYb_GnjSVsLI8biqF1CpxT8OPl7izhNQsD…" } }, "contentDetails": { "relatedPlaylists": { "uploads": "UUX6OQ3DkcsbYNE6H8uQQuVA" } }, "status": { "isFamilySafe": true }, "isVerified": true, "links": [ { "title": "Follow", "url": "https://www.instagram.com/mrbeast/" }, { "title": "Twitter", "url": "https://twitter.com/MrBeast" }, "… 1 more" ], "tabs": [ "Home", "Videos", "… 3 more" ] }, { "kind": "youtube#channel", "id": "UCBJycsmduvYEL83R_U4JriQ", "snippet": { "title": "Marques Brownlee", "description": "MKBHD: Quality Tech Videos | YouTuber | Geek | Consumer Electronics | Tech Head | Internet…", "customUrl": "@mkbhd", "handle": "@mkbhd", "publishedAt": "2008-03-21T00:00:00.000Z", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" } }, "country": "United States" }, "statistics": { "viewCount": "5915397400", "subscriberCount": "21500000", "hiddenSubscriberCount": false, "videoCount": "1868" }, "brandingSettings": { "channel": { "keywords": "MKBHD MarquesBrownlee Marques Brownlee" }, "image": { "bannerExternalUrl": "https://yt3.googleusercontent.com/zi_48HwHU4s0Hnb6tZuvRzTfCPHrLEnrtIMDLzMauDEyDmURh9JZ4wrN…" } }, "contentDetails": { "relatedPlaylists": { "uploads": "UUBJycsmduvYEL83R_U4JriQ" } }, "status": { "isFamilySafe": true }, "isVerified": true, "links": [ { "title": "Twitter", "url": "http://twitter.com/MKBHD" }, { "title": "Instagram", "url": "http://instagram.com/MKBHD" }, "… 3 more" ], "emails": [ "business@MKBHD.com" ], "tabs": [ "Home", "Videos", "… 4 more" ] } ], "pageInfo": { "totalResults": 2, "resultsPerPage": 2 }}Response fields
200 with a YouTubeChannelList, in the shape of YouTube Data API v3 resources.
| Field | Type | Description |
|---|---|---|
kind | "youtube#channelListResponse" | |
items | YouTubeChannel[] | |
pageInfo | object | |
missing | object[] | Requested ids that did not resolve, and why. |
Status codes
| Status | Meaning |
|---|---|
200 | The channels, and the ids that did not resolve. |
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
Handles too?
The batch takes channel ids; resolve handles once with the channel endpoint.
YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.