YouTube video captions by video id or URL
tikhub.x.youtube-web-v2-get-video-captionsYoutube: get video captions (web_v2)
- Price
- $0.008/successAt list price
- Success rate
- 100%Last 30 days · 1,438 calls
- Latency p50
- 2.5 sp95 8.8 s
- Last verified
- Jul 28, 2026Verified working
GEThttps://toolswitch.dev/v1/tools/tikhub.x.youtube-web-v2-get-video-captions?format=srt&video_id=dQw4w9WgXcQ&video_url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ&language_code=enBeta- Uses platform quota
- Synchronous response
- Reads public data
Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Query parameters | ||||
format | string | Optional | Caption format | srt |
video_id | string | Optional | Video ID | dQw4w9WgXcQ |
video_url | string | Optional | Video URL | https://www.youtube.com/watch?v=dQw4w9WgXcQ |
language_code | string | Optional | Language code, returns available caption list if empty | en |
- Query parameters
formatstringOptionalCaption format
Example:
srtvideo_idstringOptionalVideo ID
Example:
dQw4w9WgXcQvideo_urlstringOptionalVideo URL
Example:
https://www.youtube.com/watch?v=dQw4w9WgXcQlanguage_codestringOptionalLanguage code, returns available caption list if empty
Example:
en
Code samples
Replace $TOOLSWITCH_KEY with the key you created in the console.
Beta
curl -X GET 'https://toolswitch.dev/v1/tools/tikhub.x.youtube-web-v2-get-video-captions?format=srt&video_id=dQw4w9WgXcQ&video_url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ&language_code=en' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/tikhub.x.youtube-web-v2-get-video-captions?format=srt&video_id=dQw4w9WgXcQ&video_url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ&language_code=en",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/tikhub.x.youtube-web-v2-get-video-captions?format=srt&video_id=dQw4w9WgXcQ&video_url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdQw4w9WgXcQ&language_code=en", {
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 beta; its URL and authentication may change. The example parameters are sample data. Calls are billed at $0.008/success, including the service fee.