Search YouTube videos by keyword
youtube.youtube.search.videosSearch YouTube videos by keyword
- Price
- freeAu prix du fournisseur
- Success rate
- 100 %Last 30 days · 2 373 calls
- Latency p50
- 332 msp95 596 ms
- Last verified
- 28 juil. 2026Verified working
GEThttps://toolswitch.dev/v1/tools/youtube.youtube.search.videos?q=design+tutorial&part=snippet&type=video&maxResults=2Preview- Uses platform quota
- Synchronous response
- Reads public data
Paramètres
search results carry NO statistics — pass the returned video ids to youtube.video.detail for view/like counts
| Paramètre | Type | Obligatoire | Description | Exemple |
|---|---|---|---|---|
| Paramètres de requête | ||||
q | chaîne | Obligatoire | coffee | |
part | chaîne | Obligatoire | snippet | |
type | chaîne | Facultatif | video | channel | playlist; omit to mix all three | video |
order | chaîne | Facultatif | relevance (default) | date | viewCount | rating | title | |
maxResults | entier | Facultatif | 1–50, default 5 | 10 |
regionCode | chaîne | Facultatif | ISO 3166-1 alpha-2 | US |
publishedAfter | chaîne | Facultatif | RFC 3339 timestamp | 2026-01-01T00:00:00Z |
- Paramètres de requête
qchaîneObligatoireExemple :
coffeepartchaîneObligatoireExemple :
snippettypechaîneFacultatifvideo | channel | playlist; omit to mix all three
Exemple :
videoorderchaîneFacultatifrelevance (default) | date | viewCount | rating | title
maxResultsentierFacultatif1–50, default 5
Exemple :
10regionCodechaîneFacultatifISO 3166-1 alpha-2
Exemple :
USpublishedAfterchaîneFacultatifRFC 3339 timestamp
Exemple :
2026-01-01T00:00:00Z
Exemples de code
Remplacez $TOOLSWITCH_KEY par la clé créée dans la console.
Preview
curl -X GET 'https://toolswitch.dev/v1/tools/youtube.youtube.search.videos?q=design+tutorial&part=snippet&type=video&maxResults=2' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/youtube.youtube.search.videos?q=design+tutorial&part=snippet&type=video&maxResults=2",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/youtube.youtube.search.videos?q=design+tutorial&part=snippet&type=video&maxResults=2", {
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());Cette API de passerelle est en préversion ; son URL et son authentification peuvent changer. Les paramètres de l’exemple sont des données fictives. Les appels sont facturés à free, frais de service inclus.