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/callPelo preço do provedor
- 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
Parâmetros
| Parâmetro | Tipo | Obrigatório | Descrição | Exemplo |
|---|---|---|---|---|
| Parâmetros de consulta | ||||
url | string | Obrigatório | YouTube video or short URL | https://www.youtube.com/watch?v=bjVIDXPP7Uk |
language | string | Opcional | 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 | string | Opcional | 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 |
- Parâmetros de consulta
urlstringObrigatórioYouTube video or short URL
Exemplo:
https://www.youtube.com/watch?v=bjVIDXPP7UklanguagestringOpcional2 letter language code, ie 'en', 'es', 'fr' etc. If the transcript is not available in the language you specify, the transcript will be null.
Exemplo:
encache_max_agestringOpcionalIf 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...
Exemplo:
7d
Exemplos de código
Substitua $TOOLSWITCH_KEY pela chave criada no 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());Esta API de gateway está em prévia; a URL e a autenticação podem mudar. Os parâmetros do exemplo são dados de amostra. As chamadas são cobradas a $0.00188/call, incluindo a taxa de serviço.