Sand AISand AI MAGI-2MAGI-2 hiện đã có trên SandBase: video 1080p với âm thanh gốcDùng thử ngay

YouTube Channel Live Streams

Tài liệu API
https://api.sandbase.ai/v1/api/youtube/channel-lives

List a YouTube channel's live and past-live streams by handle or channel ID with cursor pagination (title, views, length, publish time).

Giá
Từ $0.0012USD / lượt gọi
Phương thức
POST
Phản hồi
JSON
Tham số
0 bắt buộc · 4 tùy chọn

Phòng thử nghiệm

Đầu vào
Continuation token from a previous response for pagination.
YouTube channel handle.
YouTube channel ID.
Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `lengthText`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a live stream that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted.
Đầu raSẵn sàng

Đầu ra của bạn sẽ xuất hiện ở đây

Hoàn tất đầu vào, rồi nhấp Run.

README API

YouTube Channel Live Streams API

Returns a list of a YouTube channel's live and past-live streams, with title, view count, length, and a relative publish time. Pass a channel handle such as @IShowSpeed or a channelId.

Use cases

  • Track how often a creator streams and how long each stream runs.
  • Rank a channel's past live streams by view count to find its biggest broadcasts.
  • Collect stream titles and thumbnails for a channel archive or dashboard.
  • Feed stream video IDs into a video details or transcript lookup.

Request

curl -X POST "https://api.sandbase.ai/v1/api/youtube/channel-lives" \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"handle": "@IShowSpeed"}'

The result is returned in outputs[0].data.

Parameters

NameTypeRequiredDescription
channelIdstringNoYouTube channel ID.
cursorstringNoContinuation token from a previous response for pagination.
handlestringNoYouTube channel handle.
requireFieldsarrayNoOptional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example lengthText, and it is served only by a source that returns every one

Example response

Real response for the request above, trimmed: lists keep their first item and long strings are cut.

{
  "data": {
    "lives": [
      {
        "id": "IkhjzYsvCmw",
        "image": "https://i.ytimg.com/vi/IkhjzYsvCmw/hq720.jpg",
        "lengthText": "2:00:20",
        "publishedTime": "Streamed 2d ago",
        "title": "HALLOWEEN SPIDER-MAN SPEED-VERSE IRL STREAM 🎃🕷",
        "url": "https://www.youtube.com/watch?v=IkhjzYsvCmw",
        "views": 3700000
      }
    ],
    "nextCursor": "cur_iqioDVdrk2HZB14YevFECQ"
  },
  "found": true
}

Response fields

FieldMeaning
data.lives[].idYouTube video ID of the live stream.
data.lives[].titleTitle of the stream.
data.lives[].urlFull watch URL for the stream.
data.lives[].imageThumbnail image URL.
data.lives[].viewsView count as a number.
data.lives[].lengthTextStream length as text, for example 2:00:20.
data.lives[].publishedTimeRelative publish label such as Streamed 2d ago. It is not an exact timestamp.
data.nextCursorToken for the next page of streams. Send it as cursor in the next request.
foundtrue when the channel lookup returned a result.

Notes

  • Send either handle (with the leading @) or channelId.
  • For the next page, pass data.nextCursor as cursor in the same request.
  • Set requireFields to ["lengthText"] only if you need lengthText on every stream. This can change which source serves the call and its price.
  • To get more detail on a stream, pass its id to YouTube Video Details or YouTube Video Transcript.

Pricing

Billed at the actual cost of each call, about $0.0012 for the request above. Failed calls are not charged.

Khám phá thêm

APIs liên quan

Tất cả APIs
APIGiáPhản hồi
YouTubeTừ $0.0012 mỗi lần gọiJSON
YouTubeTừ $0.00045 mỗi lần gọiJSON
YouTubeTừ $0.0012 mỗi lần gọiJSON
YouTubeTừ $0.0012 mỗi lần gọiJSON
YouTube$0.014286 mỗi lần gọiJSON
YouTube$0.014286 mỗi lần gọiJSON

Hướng dẫn:Best YouTube API in 2026: Pricing Compared

Câu hỏi

FAQ

Làm thế nào để dùng API YouTube Channel Live Streams?

Gửi yêu cầu POST đến https://api.sandbase.ai/v1/api/youtube/channel-lives với khóa API SandBase của bạn trong tiêu đề Authorization (Bearer) và các tham số trong phần thân JSON. Bạn cũng có thể thử trực tiếp trong Playground trên trang này mà không cần viết code.

API YouTube Channel Live Streams có giá bao nhiêu?

Từ $0.0012 mỗi lần gọi, được tính từ số dư SandBase của bạn. Bạn chỉ bị tính phí cho các lần gọi bạn thực hiện; không có gói đăng ký.

API YouTube Channel Live Streams chấp nhận những tham số nào?

Không có tham số bắt buộc. Tùy chọn: cursor (string), handle (string), channelId (string) và requireFields (array). Bảng Parameters và Playground trên trang này liệt kê mọi trường.

API YouTube Channel Live Streams trả về gì?

Phản hồi JSON được trả về trong cùng một yêu cầu HTTP (đồng bộ). README trên trang này có ví dụ phản hồi.

Tôi có cần tài khoản nhà phát triển hoặc API key của YouTube không?

Không. YouTube Channel Live Streams chạy thông qua SandBase, nên chỉ cần một API key SandBase là đủ cho endpoint này và mọi API cùng model khác trong danh mục. Bạn không cần đăng ký riêng để có quyền truy cập API của YouTube.