YouTube video search for a query — views, channels
serpapi.youtube.search.videosSearch YouTube videos by keyword and get titles, channels, view counts and links
- Price
- $0.015/successプロバイダー原価
- Success rate
- 100%Last 30 days · 1,335 calls
- Latency p50
- 2.5 sp95 5.4 s
- Last verified
- 2026/07/28Verified working
GEThttps://toolswitch.dev/v1/tools/serpapi.youtube.search.videos?engine=youtube&search_query=coffeePreviewTry online近日公開Provider docs ↗
- Uses platform quota
- Synchronous response
- Reads public data
パラメータ
answers arrive in `video_results`; the response may also carry `channel_results`, `movie_results`, `ads_results` and `serpapi_pagination`.
| パラメータ | 型 | 必須 | 説明 | 例 |
|---|---|---|---|---|
| クエリパラメータ | ||||
gl | 文字列 | 任意 | country code, e.g. us | us |
hl | 文字列 | 任意 | interface language code, e.g. en | en |
sp | 文字列 | 任意 | YouTube's encoded filter/pagination token — carries sort order, upload date and result-type filters | |
engine | 文字列 | 必須 | youtube | |
search_query | 文字列 | 必須 | THE QUERY PARAM IS `search_query`, NOT `q` — sending `q` to this engine returns nothing | coffee |
- クエリパラメータ
gl文字列任意country code, e.g. us
例:
ushl文字列任意interface language code, e.g. en
例:
ensp文字列任意YouTube's encoded filter/pagination token — carries sort order, upload date and result-type filters
engine文字列必須例:
youtubesearch_query文字列必須THE QUERY PARAM IS `search_query`, NOT `q` — sending `q` to this engine returns nothing
例:
coffee
コード例
$TOOLSWITCH_KEY をコンソールで作成したキーに置き換えてください。
Preview
curl -X GET 'https://toolswitch.dev/v1/tools/serpapi.youtube.search.videos?engine=youtube&search_query=coffee' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/serpapi.youtube.search.videos?engine=youtube&search_query=coffee",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/serpapi.youtube.search.videos?engine=youtube&search_query=coffee", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());このゲートウェイ API はプレビュー版です。URL や認証方式は変更される場合があります。 パラメータはサンプルデータです。 呼び出し料金は $0.015/success です。サービス料を含みます。