YouTube thumbnail API
Every thumbnail size YouTube serves for a video, with the Data API’s size names.
GET /v1/youtube/videos/{id}/thumbnailsBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/youtube/videos/dQw4w9WgXcQ/thumbnails",
headers={"Authorization": f"Bearer {os.environ['GROUNDSOCIAL_API_KEY']}"},
)
res.raise_for_status()
data = res.json()Response
200 · 1 credit{ "kind": "youtube#thumbnailList", "videoId": "dQw4w9WgXcQ", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg", "width": 480, "height": 360 }, "standard": { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sddefault.jpg", "width": 640, "height": 480 }, "maxres": { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg", "width": 1280, "height": 720 } }, "all": [ { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/default.jpg", "width": 120, "height": 90 }, { "url": "https://i.ytimg.com/vi/dQw4w9WgXcQ/mqdefault.jpg", "width": 320, "height": 180 }, "… 4 more" ]}Parameters
| Name | Type | Description |
|---|---|---|
idpath · required | string | A video or Short id, or any URL of it (watch, youtu.be, shorts, live, embed). Example: dQw4w9WgXcQ. |
Response fields
200 with a YouTubeThumbnailList, in the shape of YouTube Data API v3 resources.
| Field | Type | Description |
|---|---|---|
kind | "youtube#thumbnailList" | |
videoId | string | |
thumbnails | YouTubeThumbnails | Thumbnail URLs by size, with the Data API’s size names. |
all | YouTubeThumbnail[] | Every size YouTube serves for it. |
Status codes
| Status | Meaning |
|---|---|
200 | The thumbnails. |
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 the images proxied?
No: the URLs point at YouTube’s own image servers.
YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.