querystringwajib
The keyword to search Shorts for.
https://api.sandbase.ai/v1/api/youtube/search-shortsSearch YouTube Shorts by keyword and get matching Shorts (title, views, URL) with cursor pagination as normalized JSON.
Output Anda akan muncul di sini
Lengkapi input, lalu klik Run.
Returns YouTube Shorts that match a keyword. Each result has an ID, title, URL and view count. You only need a query, and you can sort, filter by upload date and page through results.
sortBy to popular.uploadDate to today or this_week.curl -X POST "https://api.sandbase.ai/v1/api/youtube/search-shorts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "cats"}'
The result is returned in outputs[0].data.
| Name | Type | Required | Description |
|---|---|---|---|
query | string | Yes | The keyword to search Shorts for. |
cursor | string | No | Continuation token from a previous response for pagination. |
sortBy | string | No | Sort order: "relevance" (default) or "popular" (most-viewed). |
uploadDate | string | No | Filter by upload recency. Omit for any time. |
Real response for the request above, trimmed: lists keep their first item and long strings are cut.
{
"data": {
"nextCursor": "cur_fPTLy4Ok3x74uh2aBTeYXQ",
"shorts": [
{
"contentType": "short",
"id": "M93h41hyPsM",
"title": "Ranking Funny Cat Moment",
"url": "https://www.youtube.com/watch?v=M93h41hyPsM",
"views": 17000000,
"viewsAvailable": true
}
]
},
"found": true
}
| Field | Meaning |
|---|---|
data.shorts[] | List of Shorts that match the query. |
data.shorts[].id | YouTube video ID of the Short. |
data.shorts[].title | Title of the Short. It can include hashtags and emoji. |
data.shorts[].url | Watch URL for the Short, in the form https://www.youtube.com/watch?v=<id>. |
data.shorts[].views | View count as a number. |
data.shorts[].viewsAvailable | true when a view count was found for the Short. Check it before you use views. |
data.shorts[].contentType | Type of the result. The value is short for these results. |
data.nextCursor | Token for the next page of results. Send it as cursor in the next request. |
found | true when the search returned results. |
cursor with the value of data.nextCursor.id value with YouTube Video Details to get more data about a single Short.Billed at the actual cost of each call, about $0.0012 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/search-shorts" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "cats",
"sortBy": "relevance"
}'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.
querystringwajibThe keyword to search Shorts for.
cursorstringContinuation token from a previous response for pagination.
sortBystringSort order: "relevance" (default) or "popular" (most-viewed).
Default: "relevance"
Nilai yang mungkin: relevance, popular
uploadDatestringFilter by upload recency. Omit for any time.
Nilai yang mungkin: today, this_week, this_month, this_year
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 Shorts SearchAPI ini YouTube | Dari $0.0012 per panggilan | JSON |
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 |
Pertanyaan
Kirim permintaan POST ke https://api.sandbase.ai/v1/api/youtube/search-shorts 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.0012 per panggilan, ditagihkan dari saldo SandBase Anda. Anda hanya dikenai biaya untuk panggilan yang Anda lakukan; tidak ada langganan.
Wajib: query (string). Opsional: cursor (string), sortBy (salah satu dari relevance, popular) dan uploadDate (salah satu dari today, this_week, this_month, this_year). 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 Shorts Search 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.