Sand AISand AI MAGI-2ตอนนี้ MAGI-2 อยู่บน SandBase แล้ว: วิดีโอ 1080p พร้อมเสียงในตัวลองใช้เลย

YouTube Video Streams (V2)

เอกสาร API
https://api.sandbase.ai/v1/api/youtube/web-v2/video-streams-v2

Retrieves stream information and playback details for a YouTube video. Queries data using either a video ID or a full video URL.

ราคา
$0.004USD / คำขอ
Method
POST
การตอบกลับ
JSON
พารามิเตอร์
0 จำเป็น · 2 ไม่บังคับ

Playground

อินพุต
Video ID (recommended)
Full video URL (optional, ignored if video_id is provided)
เอาต์พุตพร้อมใช้งาน

เอาต์พุตของคุณจะแสดงที่นี่

กรอกอินพุตให้ครบ แล้วคลิก Run

API README

YouTube Video Streams (V2) API

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.

Use cases

  • List the audio-only formats of a video to build a podcast-style player.
  • Pick a progressive MP4 format by quality_label and height for in-app playback.
  • Check is_live and length_seconds before queuing a video for processing.
  • Compare content_length across formats to estimate download sizes.

Request

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.

Parameters

NameTypeRequiredDescription
video_idstringNoVideo ID (recommended)
video_urlstringNoFull video URL (optional, ignored if video_id is provided)

Example response

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"
}

Response fields

FieldMeaning
title / author / video_idVideo title, channel name, and the 11-character video ID.
length_seconds / view_countVideo length in seconds and the view count.
is_livetrue if the video is a live stream, false otherwise.
short_descriptionStart of the video description text. Long descriptions are cut.
thumbnail[].urlLink 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[].urlDirect stream URL for that format. It stops working after the time set in expires_in_seconds.
bitrate / content_lengthBitrate value and file size of the format. content_length is the size of the stream data.
available_qualities / expires_in_secondsQuality labels found in the response, and the number of seconds the stream URLs stay valid.

Notes

  • Send video_id when you can. The API ignores video_url if video_id is set.
  • The video_id is the value after v= in a watch URL, such as dQw4w9WgXcQ.
  • Stream URLs are time-limited. Use them within expires_in_seconds of the call.
  • For title, description and stats without stream links, see YouTube Video Information (V2). For captions, see YouTube Video Captions.

Pricing

$0.004 per successful call. Failed calls are not charged. It is included in the daily free quota of each organization.

สำรวจเพิ่มเติม

APIs ที่เกี่ยวข้อง

APIs ทั้งหมด
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

คู่มือ:Best YouTube API in 2026: Pricing Compared

คำถาม

คำถามที่พบบ่อย

ฉันจะใช้ YouTube Video Streams (V2) API ได้อย่างไร?

ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/youtube/web-v2/video-streams-v2 โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด

YouTube Video Streams (V2) API ราคาเท่าไร?

$0.004 ต่อครั้ง คิดจากยอดคงเหลือ SandBase ของคุณ คุณจะถูกเรียกเก็บเฉพาะคำขอที่คุณส่งเท่านั้น ไม่มีค่าสมาชิกรายเดือน

YouTube Video Streams (V2) API รับพารามิเตอร์อะไรบ้าง?

ไม่ต้องระบุพารามิเตอร์ ตัวเลือก: video_id (string) และ video_url (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์

YouTube Video Streams (V2) API ส่งคืนอะไร?

การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส) README บนหน้านี้มีตัวอย่างการตอบกลับ

ฉันจำเป็นต้องมีบัญชีนักพัฒนาหรือ API key ของ YouTube ไหม?

ไม่จำเป็น YouTube Video Streams (V2) ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง YouTube API แยกต่างหาก