handlestring
YouTube channel handle.
https://api.sandbase.ai/v1/api/youtube/channelFetch a YouTube channel's stats (subscribers, video count, total views, description) and the links on its About page, by handle or channel ID.
Output Anda akan muncul di sini
Lengkapi input, lalu klik Run.
Returns public stats for one YouTube channel: title, handle, channel ID, subscriber count, video count, total views, description and avatar. It needs a channel handle such as @mkbhd or a channelId that starts with UC.
handle into a channelId so you can call other channel endpoints.curl -X POST "https://api.sandbase.ai/v1/api/youtube/channel" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"handle": "@mkbhd"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
channelId | string | No | YouTube channel ID (UC...). Pass it directly when you have it: some sources accept only the ID and otherwise look up the handle first, which adds a step. |
handle | string | No | YouTube channel handle. |
requireFields | array | No | 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 views, and it is served only by a source that returns every one of t |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"avatarUrl": "https://yt3.ggpht.com/qu4TmIaYUlS41-dJ9gZ7DUR3nilvmB5_11i6OKSdvNnBNiyOusZP1bMN6I…",
"channelId": "UCBJycsmduvYEL83R_U4JriQ",
"description": "MKBHD: Quality Tech Videos | YouTuber | Geek | Consumer Electronics | Tech Head …",
"handle": "@mkbhd",
"subscribers": 21400000,
"title": "Marques Brownlee",
"url": "https://www.youtube.com/channel/UCBJycsmduvYEL83R_U4JriQ",
"videos": 1863,
"views": 5860083118
},
"found": true
}
| Field | Meaning |
|---|---|
found | true when the channel exists. A lookup that finds nothing returns found: false. |
data.channelId | The channel's ID. It starts with UC. |
data.handle | The channel handle, including the leading @. |
data.title | The channel's display name. |
data.subscribers | Subscriber count as a whole number. |
data.videos | Number of videos on the channel. |
data.views | Total view count across the channel, as a whole number. |
data.description | The channel description text. It can contain line breaks and contact details. |
data.url / data.avatarUrl | url is the channel page link built from the channel ID. avatarUrl is the link to the channel's profile image. |
handle or channelId. Pass channelId when you have it, because it skips a handle lookup.requireFields with values such as links or views if you need those fields. The response shown here did not include a links field, so a request that requires it may be served by a different source.channelId.Billed at the actual cost of each call, about $0.00045 for the request above. Failed calls are not charged.
Mulai membangun
Endpoint API platform dengan autentikasi dan pelacakan penggunaan terpadu.
curl -X POST "https://api.sandbase.ai/v1/api/youtube/channel" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"handle": "@mkbhd"
}'Atur SandBase API key Anda di environment server Anda. Permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key Anda di server. Jangan tampilkan di kode browser.
handlestringYouTube channel handle.
channelIdstringYouTube channel ID (UC...). Pass it directly when you have it: some sources accept only the ID and otherwise look up the handle first, which adds a step.
requireFieldsarrayOptional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `views`, 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 record that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge.
Contoh respons yang disimpan untuk API ini; tidak ada permintaan langsung yang dibuat saat melihatnya.
Belum ada respons tersimpan yang dipublikasikan. Jalankan API di Playground untuk melihat responsnya.
Jelajahi lebih lanjut
| API | Harga | Respons |
|---|---|---|
YouTube ChannelAPI ini YouTube | Dari $0.00045 per panggilan | JSON |
YouTube | Dari $0.0012 per panggilan | JSON |
YouTube | Dari $0.0012 per panggilan | JSON |
YouTube | Dari $0.0012 per panggilan | JSON |
YouTube | $0.014286 per panggilan | JSON |
YouTube | $0.014286 per panggilan | JSON |
Pertanyaan
Kirim permintaan POST ke https://api.sandbase.ai/v1/api/youtube/channel dengan kunci API SandBase Anda di header Authorization (Bearer) dan parameter sebagai body JSON. Anda juga dapat mencobanya di Playground di halaman ini tanpa menulis kode.
Mulai dari $0.00045 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.
Tidak ada parameter yang wajib. Opsional: handle (string), channelId (string) dan requireFields (array). Tabel Parameters dan Playground di halaman ini mencantumkan setiap field.
Respons JSON yang dikembalikan dalam permintaan HTTP yang sama (sinkron). README di halaman ini menyertakan contoh respons.
Tidak. YouTube Channel berjalan melalui SandBase, jadi satu kunci API SandBase mencakup endpoint ini dan setiap API serta model lain di katalog. Anda tidak perlu mendaftar akses API YouTube secara terpisah.