cURL
curl "https://api.scrapio.dev/v1/youtube/subtitles?video_id=dQw4w9WgXcQ&language=en" \
-H "Authorization: Bearer $SCRAPIO_API_KEY"import os, requests
resp = requests.get(
"https://api.scrapio.dev/v1/youtube/subtitles",
headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}"},
params={"video_id": "dQw4w9WgXcQ", "language": "en"},
)
print(resp.json()["subtitles"])const params = new URLSearchParams({ video_id: "dQw4w9WgXcQ", language: "en" });
const { subtitles } = await fetch(`https://api.scrapio.dev/v1/youtube/subtitles?${params}`, {
headers: { Authorization: `Bearer ${process.env.SCRAPIO_API_KEY}` },
}).then(r => r.json());<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapio.dev/v1/youtube/subtitles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.scrapio.dev/v1/youtube/subtitles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.scrapio.dev/v1/youtube/subtitles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapio.dev/v1/youtube/subtitles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"video_id": "<string>",
"subtitles": {}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}YouTube
Get subtitles
Download subtitle/caption tracks for a YouTube video.
GET
/
v1
/
youtube
/
subtitles
cURL
curl "https://api.scrapio.dev/v1/youtube/subtitles?video_id=dQw4w9WgXcQ&language=en" \
-H "Authorization: Bearer $SCRAPIO_API_KEY"import os, requests
resp = requests.get(
"https://api.scrapio.dev/v1/youtube/subtitles",
headers={"Authorization": f"Bearer {os.environ['SCRAPIO_API_KEY']}"},
params={"video_id": "dQw4w9WgXcQ", "language": "en"},
)
print(resp.json()["subtitles"])const params = new URLSearchParams({ video_id: "dQw4w9WgXcQ", language: "en" });
const { subtitles } = await fetch(`https://api.scrapio.dev/v1/youtube/subtitles?${params}`, {
headers: { Authorization: `Bearer ${process.env.SCRAPIO_API_KEY}` },
}).then(r => r.json());<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrapio.dev/v1/youtube/subtitles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.scrapio.dev/v1/youtube/subtitles"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.scrapio.dev/v1/youtube/subtitles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapio.dev/v1/youtube/subtitles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"request_id": "<string>",
"video_id": "<string>",
"subtitles": {}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}{
"request_id": "<string>",
"error": {
"code": "<string>",
"message": "<string>"
},
"diagnostics": {
"outcome": "failed",
"retryable": true,
"blocked": true,
"timed_out": true
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
YouTube video id
Pattern:
^[A-Za-z0-9_-]{6,20}$Subtitle language
Required string length:
2 - 16Pattern:
^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$Subtitle origin: auto_generated or creator
Available options:
auto_generated, creator Include per-line timestamps
⌘I