YouTube video transcript by URL — captions, subtitles
scrapecreators.x.v1-youtube-video-transcriptRetrieves the captions, subtitles, or transcript of a YouTube video or short.
- Price
- $0.00188/callAu prix du fournisseur
- Success rate
- 99,3 %Last 30 days · 63 133 calls
- Latency p50
- 2.5 sp95 7.7 s
- Last verified
- —Not verified yet
GEThttps://toolswitch.dev/v1/tools/scrapecreators.x.v1-youtube-video-transcript?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbjVIDXPP7UkPreview- Uses platform quota
- Synchronous response
- Reads public data
Paramètres
| Paramètre | Type | Obligatoire | Description | Exemple |
|---|---|---|---|---|
| Paramètres de requête | ||||
url | chaîne | Obligatoire | YouTube video or short URL | https://www.youtube.com/watch?v=bjVIDXPP7Uk |
language | chaîne | Facultatif | 2 letter language code, ie 'en', 'es', 'fr' etc. If the transcript is not available in the language you specify, the transcript will be null. | en |
cache_max_age | chaîne | Facultatif | If we have a response in the cache that is this many days old or newer, return the cached response (0 credits, with "cached": true and a "cached_at" timestamp). Otherwise, scrape a live result (1 credit). [See the Cac... | 7d |
- Paramètres de requête
urlchaîneObligatoireYouTube video or short URL
Exemple :
https://www.youtube.com/watch?v=bjVIDXPP7UklanguagechaîneFacultatif2 letter language code, ie 'en', 'es', 'fr' etc. If the transcript is not available in the language you specify, the transcript will be null.
Exemple :
encache_max_agechaîneFacultatifIf we have a response in the cache that is this many days old or newer, return the cached response (0 credits, with "cached": true and a "cached_at" timestamp). Otherwise, scrape a live result (1 credit). [See the Cac...
Exemple :
7d
Exemples de code
Remplacez $TOOLSWITCH_KEY par la clé créée dans la console.
curl -X GET 'https://toolswitch.dev/v1/tools/scrapecreators.x.v1-youtube-video-transcript?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbjVIDXPP7Uk' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/scrapecreators.x.v1-youtube-video-transcript?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbjVIDXPP7Uk",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/scrapecreators.x.v1-youtube-video-transcript?url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbjVIDXPP7Uk", {
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 à $0.00188/call, frais de service inclus.