YouTube related videos API
The videos YouTube shows beside a video (“up next”) to a logged-out visitor, about 20, with rounded views and estimated dates.
GET /v1/youtube/videos/{id}/relatedBeta1 credit per callRefunded on failureimport os, requests
res = requests.get(
"https://api.groundsocial.dev/v1/youtube/videos/dQw4w9WgXcQ/related",
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": "yPYZpwSpKmA", "snippet": { "publishedTimeText": "17 years ago", "publishedAt": "2009-11-28T12:00:00.000Z", "publishedAtIsApproximate": true, "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw", "channelTitle": "Rick Astley", "title": "Rick Astley - Together Forever (Official Video) [4K Remaster]", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" }, "standard": { "…": "3 fields" } }, "liveBroadcastContent": "none" }, "channel": { "id": "UCuAXFkgsw1L7xaCfnd5JJOw", "title": "Rick Astley", "url": "https://www.youtube.com/channel/UCuAXFkgsw1L7xaCfnd5JJOw", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" } } }, "statistics": { "viewCount": "209000000" }, "statisticsAreApproximate": true, "contentDetails": { "duration": "PT3M24S", "durationSeconds": 204 } }, { "kind": "youtube#video", "id": "oUR7GdBTLPU", "snippet": { "publishedTimeText": "4 days ago", "publishedAt": "2026-11-20T12:00:00.000Z", "publishedAtIsApproximate": true, "channelId": "UC1EALOoYjviTgAakJ-phJFg", "channelTitle": "Tyler Vitelli", "title": "School Rules are DUMB..", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" }, "standard": { "…": "3 fields" } }, "liveBroadcastContent": "none" }, "channel": { "id": "UC1EALOoYjviTgAakJ-phJFg", "title": "Tyler Vitelli", "handle": "@tyler.vitelli", "url": "https://www.youtube.com/@tyler.vitelli", "thumbnails": { "default": { "…": "3 fields" }, "medium": { "…": "3 fields" }, "high": { "…": "3 fields" } } }, "statistics": { "viewCount": "4000000" }, "statisticsAreApproximate": true, "contentDetails": { "duration": "PT21M33S", "durationSeconds": 1293 } }, "… 1 more" ], "pageInfo": { "resultsPerPage": 5 }}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 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 | Related 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
Is it personalised?
No: it is what a fresh logged-out visitor sees.
YouTube is a trademark of Google LLC. We are not affiliated with or endorsed by Google or YouTube.