video_idstring
Video ID (recommended)
https://api.sandbase.ai/v1/api/youtube/web-v2/video-streams-v2Retrieves stream information and playback details for a YouTube video. Queries data using either a video ID or a full video URL.
आपका आउटपुट यहाँ दिखाई देगा
इनपुट पूरा करें, फिर Run पर क्लिक करें।
Returns stream details for one YouTube video: title, author, length, view count, and lists of downloadable video and audio formats with their URLs. It needs a video_id or a full video_url.
quality_label and height for in-app playback.is_live and length_seconds before queuing a video for processing.content_length across formats to estimate download sizes.curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/video-streams-v2" \
-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 |
|---|---|---|---|
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.
{
"adaptive_formats": [
{
"audio_quality": 30.813,
"audio_sample_rate": 22050,
"bitrate": 30.813,
"content_length": 821022,
"fps": null,
"has_signature": false,
"height": null,
"itag": 599,
"mime_type": "audio/mp4",
"quality": "ultralow",
"quality_label": "audio only",
"type": "audio"
}
],
"author": "Rick Astley",
"available_qualities": [
"audio only"
],
"expires_in_seconds": 21600,
"formats": [
{
"audio_quality": null,
"audio_sample_rate": 44100,
"bitrate": 444.226,
"content_length": 11832459,
"fps": 25,
"has_signature": false,
"height": 360,
"itag": 18,
"mime_type": "video/mp4",
"quality": "360p",
"quality_label": "640x360",
"type": "video"
}
],
"is_live": false,
"length_seconds": 213,
"short_description": "The official video for “Never Gonna Give You Up” by Rick Astley. \n\nNever: The Au…",
"strategy": "account_mweb",
"thumbnail": [
{
"url": "https://i.ytimg.com/vi_webp/dQw4w9WgXcQ/maxresdefault.webp"
}
],
"title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)",
"video_id": "dQw4w9WgXcQ"
}
| Field | Meaning |
|---|---|
title / author / video_id | Video title, channel name, and the 11-character video ID. |
length_seconds / view_count | Video length in seconds and the view count. |
is_live | true if the video is a live stream, false otherwise. |
short_description | Start of the video description text. Long descriptions are cut. |
thumbnail[].url | Link to a thumbnail image for the video. |
formats[] | Formats that carry video in a single file. Each row has itag, mime_type, quality, quality_label, width, height and fps. |
adaptive_formats[] | Separate audio-only or video-only formats. Check type to tell them apart, and audio_sample_rate for audio rows. |
formats[].url / adaptive_formats[].url | Direct stream URL for that format. It stops working after the time set in expires_in_seconds. |
bitrate / content_length | Bitrate value and file size of the format. content_length is the size of the stream data. |
available_qualities / expires_in_seconds | Quality labels found in the response, and the number of seconds the stream URLs stay valid. |
video_id when you can. The API ignores video_url if video_id is set.video_id is the value after v= in a watch URL, such as dQw4w9WgXcQ.expires_in_seconds of the call.$0.004 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/video-streams-v2" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_id": "dQw4w9WgXcQ",
"video_url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}'अपने SandBase API key को अपने सर्वर environment में सेट करें। Requests Bearer authentication का उपयोग करती हैं।
export SANDBASE_API_KEY="YOUR_API_KEY"अपना key सर्वर पर रखें। इसे browser code में expose न करें।
video_idstringVideo ID (recommended)
video_urlstringFull video URL (optional, ignored if video_id is provided)
इस API के लिए सेव किया गया example response; इसे देखते समय कोई live request नहीं की जाती।
कोई सेव response प्रकाशित नहीं किया गया है। इसका response देखने के लिए Playground में API चलाएँ।
और जानें
| API | कीमत | प्रतिक्रिया |
|---|---|---|
YouTube | $0.004 प्रति कॉल | 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/video-streams-v2 पर Authorization header (Bearer) में अपनी SandBase API key और parameters को JSON body के रूप में भेजें। आप इस पेज के Playground में बिना code लिखे भी इसे आज़मा सकते हैं।
$0.004 प्रति call, आपकी SandBase balance से बिल किया जाएगा। आपसे केवल आपके किए गए calls के लिए शुल्क लिया जाता है; कोई subscription नहीं है।
कोई parameters आवश्यक नहीं हैं। वैकल्पिक: video_id (string) और video_url (string)। Parameters table और इस पेज का Playground हर field सूचीबद्ध करते हैं।
एक JSON response जो उसी HTTP request में लौटाया जाता है (synchronous)। इस पेज का README एक sample response शामिल करता है।
नहीं। YouTube Video Streams (V2) SandBase के माध्यम से चलता है, इसलिए एक SandBase API key इस endpoint और catalog के हर अन्य API और model को कवर करती है। आपको अलग से YouTube API access के लिए आवेदन करने की आवश्यकता नहीं है।