Sand AISand AI MAGI-2MAGI-2 artık SandBase'de: yerel sesli 1080p videoŞimdi deneyin

YouTube Video Streams (V2)

API dokümanları
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.

Fiyat
$0.004USD / çağrı
Yöntem
POST
Yanıt
JSON
Parametreler
0 gerekli · 2 isteğe bağlı

Oynatma Alanı

Girdi
Video ID (recommended)
Full video URL (optional, ignored if video_id is provided)
ÇıktıHazır

Çıktınız burada görünecek

Girdileri tamamlayın, ardından Çalıştır'a tıklayın.

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.

Daha fazlasını keşfedin

İlgili APIs

Tüm APIs
APIFiyatYanıt
YouTube$0.004 çağrı başınaJSON
YouTube$0.001 çağrı başınaJSON
YouTube$0.001 çağrı başınaJSON
YouTube$0.001 çağrı başınaJSON
YouTube$0.001 çağrı başınaJSON
YouTube$0.001 çağrı başınaJSON

Kılavuzlar:Best YouTube API in 2026: Pricing Compared

Sorular

SSS

YouTube Video Streams (V2) API'sini nasıl kullanırım?

SandBase API anahtarınızı Authorization başlığında (Bearer) ve parametreleri JSON gövdesi olarak ile https://api.sandbase.ai/v1/api/youtube/web-v2/video-streams-v2 adresine bir POST isteği gönderin. Ayrıca bu sayfadaki Playground’da kod yazmadan da deneyebilirsiniz.

YouTube Video Streams (V2) API'sinin fiyatı nedir?

çağrı başına $0.004, SandBase bakiyenizden tahsil edilir. Yalnızca yaptığınız çağrılar için ücretlendirilirsiniz; abonelik yoktur.

YouTube Video Streams (V2) API'si hangi parametreleri kabul eder?

Gerekli parametre yoktur. İsteğe bağlı: video_id (string) ve video_url (string). Parametreler tablosu ve bu sayfadaki Playground, tüm alanları listeler.

YouTube Video Streams (V2) API'si ne döndürür?

Aynı HTTP isteğinde döndürülen bir JSON yanıtı (senkron). Bu sayfadaki README'de örnek bir yanıt yer alır.

Bir YouTube geliştirici hesabına veya API anahtarına ihtiyacım var mı?

Hayır. YouTube Video Streams (V2), SandBase üzerinden çalışır; bu nedenle tek bir SandBase API anahtarı bu uç noktayı ve katalogdaki diğer tüm API'leri ve modelleri kapsar. YouTube API erişimi için ayrıca başvuru yapmanız gerekmez.