querystring必須
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.
出力はここに表示されます
入力を完了してから[実行]をクリックしてください。
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.
開発を始める
統一認証と使用状況の追跡を備えたプラットフォームAPIエンドポイントです。
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"
}'SandBaseのAPIキーをサーバー環境に設定してください。リクエストはBearer認証を使用します。
export SANDBASE_API_KEY="YOUR_API_KEY"キーはサーバー側で管理してください。ブラウザコードに公開しないでください。
querystring必須The keyword to search Shorts for.
cursorstringContinuation token from a previous response for pagination.
sortBystringSort order: "relevance" (default) or "popular" (most-viewed).
デフォルト: "relevance"
指定可能な値: relevance, popular
uploadDatestringFilter by upload recency. Omit for any time.
指定可能な値: today, this_week, this_month, this_year
このAPIの保存済みサンプルレスポンスです。表示時にライブリクエストは行われません。
保存済みレスポンスはまだ公開されていません。PlaygroundでAPIを実行し、レスポンスを確認してください。
さらに探索
| API | 価格 | レスポンス |
|---|---|---|
YouTube Shorts Searchこの API YouTube | 1回あたり $0.0012 から | JSON |
YouTube | 1回あたり $0.00045 から | JSON |
YouTube | 1回あたり $0.0012 から | JSON |
YouTube | 1回あたり $0.0012 から | JSON |
YouTube | 1回あたり $0.0012 から | JSON |
YouTube | $0.014286 / 回 | JSON |
質問
Authorization ヘッダー(Bearer)に SandBase API key を指定し、パラメータを JSON ボディで送信して https://api.sandbase.ai/v1/api/youtube/search-shorts に POST リクエストを送ります。このページの Playground で、コードを書かずに試すこともできます。
1回あたり $0.0012 から、SandBase 残高から課金されます。課金対象はご利用分のみで、サブスクリプションはありません。
必須: query (string)。 任意: cursor (string), sortBy(relevance, popular のいずれか) と uploadDate(today, this_week, this_month, this_year のいずれか)。 このページの Parameters テーブルと Playground に、すべてのフィールドが一覧表示されています。
同じ HTTP リクエスト内で返される JSON レスポンスです(同期)。 このページの README にサンプルレスポンスがあります。
いいえ。YouTube Shorts Search は SandBase 経由で動作するため、SandBase の API key 1つでこのエンドポイントと、カタログ内の他のすべての API とモデルを利用できます。YouTube の API アクセスを別途申請する必要はありません。