need_formatboolean
Whether to format data (default true)
डिफ़ॉल्ट: true
https://api.sandbase.ai/v1/api/youtube/web-v2/related-videosReturns a list of related videos for a given YouTube video by ID or URL. Includes an option to format the returned output structure.
[
{
"data": {
"related_videos": [
{
"author": "Legends 80s Music",
"author_id": "UCLYghx74Jmn2hQ62qhm6FkQ",
"author_url": "https://www.youtube.com/channel/UCLYghx74Jmn2hQ62qhm6FkQ",
"length_seconds": null,
"length_text": null,
"published_time_text": "Streamed 2 months ago",
"thumbnails": [
{
"height": 94,
"url": "https://i.ytimg.com/vi/SdWBgeFxb2M/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLDuCFK2Y-iq4HR9h-3ZFnZwYX8Ziw",
"width": 168
},
{
"height": 188,
"url": "https://i.ytimg.com/vi/SdWBgeFxb2M/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDXpvWlpIlQyY7PrSZOOUUkBkfqtQ",
"width": 336
}
],
"title": "Best of 80s Music Legends - Tears For Fears, Madonna, Cyndi Lauper, Modern Talking, Michael Jackson",
"video_id": "SdWBgeFxb2M",
"video_url": "https://www.youtube.com/watch?v=SdWBgeFxb2M",
"view_count_text": "2.3M views"
},
{
"author": "Jaime Bayly",
"author_id": "UCXpBQR0HEcj56-spwHvDSIg",
"author_url": "https://www.youtube.com/channel/UCXpBQR0HEcj56-spwHvDSIg",
"length_seconds": null,
"length_text": null,
"published_time_text": "9 hours ago",
"thumbnails": [
{
"height": 94,
"url": "https://i.ytimg.com/vi/BlfSjG7hcwI/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCm93umqC1RT_jni5sg-CymweH8fA",
"width": 168
},
{
"height": 188,
"url": "https://i.ytimg.com/vi/BlfSjG7hcwI/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBGD26OMJkvjf61MQh6ZFugvXaesw",
"width": 336
}
],
"title": "Solo el 33% lo aprueba",
"video_id": "BlfSjG7hcwI",
"video_url": "https://www.youtube.com/watch?v=BlfSjG7hcwI",
"view_count_text": "52K views"
},
{
"author": "Highway Roots Music",
"author_id": "UC1Y72Gde1MOEV-TgFywDlDA",
"author_url": "https://www.youtube.com/channel/UC1Y72Gde1MOEV-TgFywDlDA",
"length_seconds": null,
"length_text": null,
"published_time_text": "4 months ago",
"thumbnails": [
{
"height": 94,
"url": "https://i.ytimg.com/vi/uzaVxDQ6Dk4/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLClqh_mFhls0R52Y5SRD-oiKTPQMQ",
"width": 168
},
{
"height": 188,
"url": "https://i.ytimg.com/vi/uzaVxDQ6Dk4/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCm2FOgMCD8P5g0Xs6acJzQ6RXwlQ",
"width": 336
}
],
"title": "Whiskey Blues Playlist 20 Best Slow Blues Songs Late Night Blues Mix",
"video_id": "uzaVxDQ6Dk4",
"video_url": "https://www.youtube.com/watch?v=uzaVxDQ6Dk4",
"view_count_text": "1.2M views"
},
"… 17 more items in the full response"
],
"total_count": 20,
"video_id": "dQw4w9WgXcQ"
}
}
]प्लेग्राउंड में इसके इनपुट और परिणाम लोड करने के लिए कोई उदाहरण चुनें।
Returns a list of videos that YouTube shows as related to a given video. Send a video_id or a full video_url. Each item has the title, channel, thumbnails, and a link to the related video.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/related-videos" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"video_id": "dQw4w9WgXcQ", "video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
need_format | boolean | No | Whether to format data (default true) |
video_id | string | No | Video ID (recommended) |
video_url | string | No | Full video URL (optional, ignored if video_id is provided) |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"related_videos": [
{
"author": "Retro Pulse",
"author_id": "UCoDu_E2c5wI_zgfW4mdT0KQ",
"author_url": "https://www.youtube.com/channel/UCoDu_E2c5wI_zgfW4mdT0KQ",
"length_seconds": null,
"length_text": null,
"published_time_text": "3mo ago",
"thumbnails": [
{
"height": 94,
"url": "https://i.ytimg.com/vi/KLERRzVzPHI/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDgg…",
"width": 168
}
],
"title": "Best of 80s Music Legends - Tears For Fears, Madonna, Cyndi Lauper, Modern Talki…",
"video_id": "KLERRzVzPHI",
"video_url": "https://www.youtube.com/watch?v=KLERRzVzPHI",
"view_count_text": "470K"
}
],
"total_count": 20,
"video_id": "dQw4w9WgXcQ"
}
| Field | Meaning |
|---|---|
related_videos[] | List of related videos for the input video. |
related_videos[].video_id / related_videos[].video_url | ID of the related video and its full watch URL. |
related_videos[].title | Title of the related video. |
related_videos[].author / related_videos[].author_id / related_videos[].author_url | Name of the channel that posted the video, its channel ID, and its channel URL. |
related_videos[].view_count_text | View count as short display text, for example 29M. It is a string, not a number. |
related_videos[].published_time_text | Relative publish age as display text, for example 3mo ago or 6y ago. |
related_videos[].thumbnails[] | Thumbnail images, each with url, width, and height. |
related_videos[].length_seconds / related_videos[].length_text | Video length. Both are null in this response, so do not rely on them. |
total_count | Number of related videos returned. |
video_id | The video ID the related list was built for. |
video_id when you have it. video_url is ignored if video_id is set.video_id is the v value in a watch URL, such as dQw4w9WgXcQ in https://www.youtube.com/watch?v=dQw4w9WgXcQ.need_format to false if you want the unformatted output structure.video_id to YouTube Video Information for full details, or to YouTube Video Comments for its comments.$0.001 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.
बिल्डिंग शुरू करें
एकीकृत authentication और usage tracking के साथ Platform API endpoint.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/related-videos" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_id": "dQw4w9WgXcQ",
"video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"need_format": true
}'अपने SandBase API key को अपने सर्वर environment में सेट करें। Requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"अपना key सर्वर पर रखें। इसे browser code में expose न करें।
need_formatbooleanWhether to format data (default true)
डिफ़ॉल्ट: true
video_idstringVideo ID (recommended)
video_urlstringFull video URL (optional, ignored if video_id is provided)
इस API के लिए सेव किया गया example response; इसे देखते समय कोई live request नहीं की जाती।
[
{
"data": {
"related_videos": [
{
"author": "Legends 80s Music",
"author_id": "UCLYghx74Jmn2hQ62qhm6FkQ",
"author_url": "https://www.youtube.com/channel/UCLYghx74Jmn2hQ62qhm6FkQ",
"length_seconds": null,
"length_text": null,
"published_time_text": "Streamed 2 months ago",
"thumbnails": [
{
"height": 94,
"url": "https://i.ytimg.com/vi/SdWBgeFxb2M/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLDuCFK2Y-iq4HR9h-3ZFnZwYX8Ziw",
"width": 168
},
{
"height": 188,
"url": "https://i.ytimg.com/vi/SdWBgeFxb2M/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLDXpvWlpIlQyY7PrSZOOUUkBkfqtQ",
"width": 336
}
],
"title": "Best of 80s Music Legends - Tears For Fears, Madonna, Cyndi Lauper, Modern Talking, Michael Jackson",
"video_id": "SdWBgeFxb2M",
"video_url": "https://www.youtube.com/watch?v=SdWBgeFxb2M",
"view_count_text": "2.3M views"
},
{
"author": "Jaime Bayly",
"author_id": "UCXpBQR0HEcj56-spwHvDSIg",
"author_url": "https://www.youtube.com/channel/UCXpBQR0HEcj56-spwHvDSIg",
"length_seconds": null,
"length_text": null,
"published_time_text": "9 hours ago",
"thumbnails": [
{
"height": 94,
"url": "https://i.ytimg.com/vi/BlfSjG7hcwI/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLCm93umqC1RT_jni5sg-CymweH8fA",
"width": 168
},
{
"height": 188,
"url": "https://i.ytimg.com/vi/BlfSjG7hcwI/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLBGD26OMJkvjf61MQh6ZFugvXaesw",
"width": 336
}
],
"title": "Solo el 33% lo aprueba",
"video_id": "BlfSjG7hcwI",
"video_url": "https://www.youtube.com/watch?v=BlfSjG7hcwI",
"view_count_text": "52K views"
},
{
"author": "Highway Roots Music",
"author_id": "UC1Y72Gde1MOEV-TgFywDlDA",
"author_url": "https://www.youtube.com/channel/UC1Y72Gde1MOEV-TgFywDlDA",
"length_seconds": null,
"length_text": null,
"published_time_text": "4 months ago",
"thumbnails": [
{
"height": 94,
"url": "https://i.ytimg.com/vi/uzaVxDQ6Dk4/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLClqh_mFhls0R52Y5SRD-oiKTPQMQ",
"width": 168
},
{
"height": 188,
"url": "https://i.ytimg.com/vi/uzaVxDQ6Dk4/hqdefault.jpg?sqp=-oaymwEcCNACELwBSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLCm2FOgMCD8P5g0Xs6acJzQ6RXwlQ",
"width": 336
}
],
"title": "Whiskey Blues Playlist 20 Best Slow Blues Songs Late Night Blues Mix",
"video_id": "uzaVxDQ6Dk4",
"video_url": "https://www.youtube.com/watch?v=uzaVxDQ6Dk4",
"view_count_text": "1.2M views"
},
"… 17 more items in the full response"
],
"total_count": 20,
"video_id": "dQw4w9WgXcQ"
}
}
]और जानें
| API | कीमत | प्रतिक्रिया |
|---|---|---|
YouTube | $0.001 प्रति कॉल | JSON |
YouTube | $0.001 प्रति कॉल | JSON |
YouTube | $0.001 प्रति कॉल | JSON |
YouTube | $0.001 प्रति कॉल | JSON |
YouTube | $0.001 प्रति कॉल | JSON |
YouTube | $0.001 प्रति कॉल | JSON |
प्रश्न
https://api.sandbase.ai/v1/api/youtube/web-v2/related-videos पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।
$0.001 प्रति call, आपकी SandBase balance से बिल किया जाएगा। आपसे केवल आपके किए गए calls के लिए शुल्क लिया जाता है; कोई subscription नहीं है।
कोई parameters आवश्यक नहीं हैं। वैकल्पिक: need_format (boolean), video_id (string) और video_url (string)। Parameters table और इस पेज का Playground हर field सूचीबद्ध करते हैं।
एक JSON response जो उसी HTTP request में लौटाया जाता है (synchronous)। इस पेज का README एक sample response शामिल करता है।
नहीं। YouTube Related Videos (Web V2) SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से YouTube API access के लिए आवेदन करने की आवश्यकता नहीं है।