YouTube video stats by video id — views, likes, duration
youtube.youtube.video.detailGet a YouTube video's metadata and stats (views, likes, comments, duration)
- Price
- freeZum Anbieterpreis
- Success rate
- 100 %Last 30 days · 7.337 calls
- Latency p50
- 186 msp95 395 ms
- Last verified
- 28.07.2026Verified working
GEThttps://toolswitch.dev/v1/tools/youtube.youtube.video.detail?id=dQw4w9WgXcQ&part=snippet%2CstatisticsPreview- Uses platform quota
- Synchronous response
- Reads public data
Parameter
batching 50 ids costs the same 1 unit as one id — always batch
| Parameter | Typ | Erforderlich | Beschreibung | Beispiel |
|---|---|---|---|---|
| Abfrageparameter | ||||
id | Zeichenkette | Erforderlich | video id (the v= parameter of the watch URL); up to 50 comma-separated ids in one call | dQw4w9WgXcQ |
part | Zeichenkette | Erforderlich | snippet=title/description/tags, statistics=counts, contentDetails=duration | snippet,statistics,contentDetails |
- Abfrageparameter
idZeichenketteErforderlichvideo id (the v= parameter of the watch URL); up to 50 comma-separated ids in one call
Beispiel:
dQw4w9WgXcQpartZeichenketteErforderlichsnippet=title/description/tags, statistics=counts, contentDetails=duration
Beispiel:
snippet,statistics,contentDetails
Codebeispiele
Ersetze $TOOLSWITCH_KEY durch den in der Konsole erstellten Schlüssel.
Preview
curl -X GET 'https://toolswitch.dev/v1/tools/youtube.youtube.video.detail?id=dQw4w9WgXcQ&part=snippet%2Cstatistics' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/youtube.youtube.video.detail?id=dQw4w9WgXcQ&part=snippet%2Cstatistics",
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.video.detail?id=dQw4w9WgXcQ&part=snippet%2Cstatistics", {
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());Diese Gateway-API ist eine Vorschauversion; URL und Authentifizierung können sich ändern. Die Beispielparameter sind Musterdaten. Aufrufe werden mit free einschließlich Servicegebühr abgerechnet.