itagintegerจำเป็น
Format identifier, selected from formats list returned by get_video_streams
https://api.sandbase.ai/v1/api/youtube/web-v2/signed-stream-urlReturns a signed playback stream URL for a specific YouTube video format. Requires a format itag identifier alongside either a video ID or full video link.
[
{
"data": {
"expires_in_seconds": 21600,
"itag": 18,
"url": "https://rr6---sn-bvvbaxivnuxqjvhj5nu-hp56.googlevideo.com/videoplayback?expire=1790713536&ei=YMq7aqHfG_yLut0P-tTSSQ&ip=76.153.140.203&id=o-AFy0UPGNBbD9EAfvG-1LN4Ye9_CrF5MOUXqWHJjzKY7H&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1790691936%2C&mh=7c&mm=18%2C29&mn=sn-bvvbaxivnuxqjvhj5nu-hp56%2Csn-hp57knk7&ms=aub%2Crdu&mv=m&mvi=6&pl=23&rms=aub%2Caub&initcwndbps=4024500&bui=AWzQHwrkGdalR1KzZo862nm05ap9aIF1UE7YfGBWL4YbLSGNh82tuy5DdfQjXvYrJbcMD8qhdAdSk643&spc=I-rgIRoihLWN_AtuHQdSzB9qnW93I9Vsc6DVqsVNW3CV-l3kEZd2tdS7jnjdCTEPx7xbFU7UIO7s5eeRl5Iw7OIO6qd5O_dO7s0&vprv=1&svpuc=1&mime=vide…"
}
}
]เลือกตัวอย่างเพื่อโหลดอินพุตและผลลัพธ์ลงใน playground
Returns a signed playback stream URL ready for playback using a format itag and either a video_id or video_url.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/signed-stream-url" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"itag": 18}'
| Name | Type | Required | Description |
|---|---|---|---|
itag | integer | Yes | Format identifier, selected from formats list returned by get_video_streams |
video_id | string | No | Video ID (recommended) |
video_url | string | No | Full video URL (optional) |
itag value must come from the formats list returned by the video streams endpoint.video_id (recommended) or video_url to specify the target video.Flat price per call. Failed calls, including lookups whose target does not exist, are not charged.
เริ่มสร้าง
เอ็นด์พอยต์ของ Platform API ที่มีการยืนยันตัวตนและการติดตามการใช้งานแบบรวมศูนย์
curl -X POST "https://api.sandbase.ai/v1/api/youtube/web-v2/signed-stream-url" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"itag": 18,
"video_id": "dQw4w9WgXcQ"
}'ตั้งค่า SandBase API key ของคุณในสภาพแวดล้อมฝั่งเซิร์ฟเวอร์ คำขอจะใช้การยืนยันตัวตนแบบ Bearer
export SANDBASE_API_KEY="YOUR_API_KEY"เก็บ key ไว้บนเซิร์ฟเวอร์ อย่าเปิดเผยในโค้ดฝั่งเบราว์เซอร์
itagintegerจำเป็นFormat identifier, selected from formats list returned by get_video_streams
video_idstringVideo ID (recommended)
video_urlstringFull video URL (optional)
บันทึกตัวอย่างการตอบกลับสำหรับ API นี้; จะไม่มีการส่งคำขอจริงเมื่อเปิดดู
[
{
"data": {
"expires_in_seconds": 21600,
"itag": 18,
"url": "https://rr6---sn-bvvbaxivnuxqjvhj5nu-hp56.googlevideo.com/videoplayback?expire=1790713536&ei=YMq7aqHfG_yLut0P-tTSSQ&ip=76.153.140.203&id=o-AFy0UPGNBbD9EAfvG-1LN4Ye9_CrF5MOUXqWHJjzKY7H&itag=18&source=youtube&requiressl=yes&xpc=EgVo2aDSNQ%3D%3D&met=1790691936%2C&mh=7c&mm=18%2C29&mn=sn-bvvbaxivnuxqjvhj5nu-hp56%2Csn-hp57knk7&ms=aub%2Crdu&mv=m&mvi=6&pl=23&rms=aub%2Caub&initcwndbps=4024500&bui=AWzQHwrkGdalR1KzZo862nm05ap9aIF1UE7YfGBWL4YbLSGNh82tuy5DdfQjXvYrJbcMD8qhdAdSk643&spc=I-rgIRoihLWN_AtuHQdSzB9qnW93I9Vsc6DVqsVNW3CV-l3kEZd2tdS7jnjdCTEPx7xbFU7UIO7s5eeRl5Iw7OIO6qd5O_dO7s0&vprv=1&svpuc=1&mime=vide…"
}
}
]สำรวจเพิ่มเติม
| 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 |
คำถาม
ส่งคำขอ POST ไปที่ https://api.sandbase.ai/v1/api/youtube/web-v2/signed-stream-url โดยใส่ SandBase API key ของคุณใน Authorization header (Bearer) และส่งพารามิเตอร์เป็น JSON body คุณยังสามารถลองใช้ได้ใน Playground บนหน้านี้โดยไม่ต้องเขียนโค้ด
$0.001 ต่อครั้ง ทุกองค์กรจะได้รับคำขอฟรี 100 ครั้งต่อวัน UTC โดยใช้ร่วมกันใน SandBase APIs ที่เข้าเงื่อนไขรวมถึงรายการนี้ หลังจากนั้นแต่ละคำขอจะคิดค่าบริการตามราคานี้จากยอดคงเหลือ SandBase ของคุณ ไม่มีค่าสมาชิกรายเดือน
ที่ต้องระบุ: itag (integer). ตัวเลือก: video_id (string) และ video_url (string). ตาราง Parameters และ Playground ในหน้านี้แสดงทุกฟิลด์
การตอบกลับ JSON ที่ส่งกลับในคำขอ HTTP เดียวกัน (แบบซิงโครนัส)
ไม่จำเป็น YouTube Signed Video Stream URL ทำงานผ่าน SandBase ดังนั้น SandBase API key เดียวครอบคลุม endpoint นี้และทุก API กับโมเดลอื่นในแค็ตตาล็อก คุณไม่ต้องสมัครขอสิทธิ์เข้าถึง YouTube API แยกต่างหาก