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

YouTube Video Streams

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

Returns stream details and media information for a specified YouTube video. Queries accept either a direct video identifier or a full video URL.

ราคา
$0.001USD / คำขอ
Method
POST
การตอบกลับ
JSON
พารามิเตอร์
0 จำเป็น · 2 ไม่บังคับ
100 คำขอฟรี / วันคำขอ 100 ครั้งแรกต่อวันฟรี (ใช้ร่วมกันภายในองค์กร) · รีเซ็ตเวลา 00:00 UTC จากนั้นคิดค่าบริการตามจำนวนคำขอ

Playground

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

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

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

API README

YouTube Video Streams API

Returns the downloadable stream formats for one YouTube video, with basic video details such as title, author and length. It needs a video_id or a full video_url.

Use cases

  • List the available audio and video formats for a video before choosing one to download.
  • Pick an audio-only stream by itag and mime_type for a podcast or transcription tool.
  • Check the available resolutions for a video before building a playback or preview tool.
  • Read the title, author, duration and view count of a video in the same call as its streams.

Request

curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/video-streams" \
  -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_idTitle of the video, name of the channel that published it, and the video ID.
length_secondsLength of the video in seconds.
view_countNumber of views on the video.
is_liveWhether the video is a live stream (false for this video).
available_qualitiesList of quality labels offered, such as audio only, 854x480 and 640x360.
formats[]Streams that carry video and audio together. Each row has itag, mime_type, quality_label, width, height, fps, bitrate and content_length.
adaptive_formats[]Separate streams, such as audio only. Each row has type, itag, mime_type, quality_label, audio_sample_rate, bitrate and content_length.
formats[].url / adaptive_formats[].urlDirect link to the media stream for that format.
expires_in_secondsNumber of seconds given for the stream URLs, 21600 in this response.
thumbnail[].urlLink to a thumbnail image of the video.

Notes

  • Send video_id when you have it. video_url is ignored if video_id is provided.
  • The video_id is the 11-character value after v= in a YouTube watch URL, such as dQw4w9WgXcQ.
  • Fields like width, height and fps are null for audio-only streams.
  • For video details without stream links, see YouTube Video Information. For another stream response, see YouTube Video Streams (V2).

Pricing

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

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

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

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

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

คำถาม

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

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

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

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

$0.001 ต่อครั้ง ทุกองค์กรจะได้รับคำขอฟรี 100 ครั้งต่อวัน UTC โดยใช้ร่วมกันใน SandBase APIs ที่เข้าเงื่อนไขรวมถึงรายการนี้ หลังจากนั้นแต่ละคำขอจะคิดค่าบริการตามราคานี้จากยอดคงเหลือ SandBase ของคุณ ไม่มีค่าสมาชิกรายเดือน

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

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

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

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

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

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