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/successAt provider cost
- Success rate
- 100%Last 30 days · 1,335 calls
- Latency p50
- 2.5 sp95 5.4 s
- Last verified
- Jul 28, 2026Verified working
GEThttps://toolswitch.dev/v1/tools/serpapi.youtube.search.videos?engine=youtube&search_query=coffeePreview- Uses platform quota
- Synchronous response
- Reads public data
Parameters
answers arrive in `video_results`; the response may also carry `channel_results`, `movie_results`, `ads_results` and `serpapi_pagination`.
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Query parameters | ||||
gl | string | Optional | country code, e.g. us | us |
hl | string | Optional | interface language code, e.g. en | en |
sp | string | Optional | YouTube's encoded filter/pagination token — carries sort order, upload date and result-type filters | |
engine | string | Required | youtube | |
search_query | string | Required | THE QUERY PARAM IS `search_query`, NOT `q` — sending `q` to this engine returns nothing | coffee |
- Query parameters
glstringOptionalcountry code, e.g. us
Example:
ushlstringOptionalinterface language code, e.g. en
Example:
enspstringOptionalYouTube's encoded filter/pagination token — carries sort order, upload date and result-type filters
enginestringRequiredExample:
youtubesearch_querystringRequiredTHE QUERY PARAM IS `search_query`, NOT `q` — sending `q` to this engine returns nothing
Example:
coffee
Code samples
Replace $TOOLSWITCH_KEY with the key you created in the console.
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());This gateway API is in preview; its URL and authentication may change. The example parameters are sample data. Calls are billed at $0.015/success, including the service fee.