Node.js
import { Supadata } from '@supadata/js';
const supadata = new Supadata({
apiKey: 'YOUR_API_KEY',
});
const batchResults = await supadata.youtube.batch.getBatchResults(JOB_ID);
console.log(batchResults);from supadata import Supadata, SupadataError
supadata = Supadata(api_key="YOUR_API_KEY")
batch_results = supadata.youtube.batch.get_batch_results(job_id=JOB_ID)
print(batch_results)curl -X GET "https://api.supadata.ai/v1/youtube/batch/JOB_ID" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json"const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.supadata.ai/v1/youtube/batch/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.supadata.ai/v1/youtube/batch/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.supadata.ai/v1/youtube/batch/{jobId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.supadata.ai/v1/youtube/batch/{jobId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.supadata.ai/v1/youtube/batch/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "completed",
"results": [
{
"videoId": "dQw4w9WgXcQ",
"transcript": {
"content": [
{
"text": "Never gonna give you up...",
"offset": 8150,
"duration": 1200,
"lang": "en"
}
],
"lang": "en",
"availableLangs": [
"en",
"es",
"zh-TW"
]
},
"video": {
"id": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Music Video)",
"description": "The official music video for \"Never Gonna Give You Up\"...",
"duration": 213,
"channel": {
"id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"name": "Rick Astley"
},
"tags": [
"Rick Astley",
"Official Video",
"Music"
],
"transcriptLanguages": [
"en",
"es",
"fr"
],
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
"uploadDate": "2009-10-25T00:00:00.000Z",
"viewCount": 1234567890,
"likeCount": 12345678
},
"errorCode": "not-found"
}
],
"stats": {
"total": 10,
"succeeded": 8,
"failed": 2
},
"errorCode": "job-expired",
"completedAt": "2025-04-03T06:59:53.428Z"
}{
"error": "invalid-request",
"message": "Invalid Request",
"details": "The request is invalid or malformed",
"documentationUrl": "https://docs.supadata.ai/errors#invalid-request"
}{
"error": "invalid-request",
"message": "Invalid Request",
"details": "The request is invalid or malformed",
"documentationUrl": "https://docs.supadata.ai/errors#invalid-request"
}{
"error": "invalid-request",
"message": "Invalid Request",
"details": "The request is invalid or malformed",
"documentationUrl": "https://docs.supadata.ai/errors#invalid-request"
}YouTube Endpoints
Batch Result
Get the status and results of a YouTube batch job.
GET
/
youtube
/
batch
/
{jobId}
Node.js
import { Supadata } from '@supadata/js';
const supadata = new Supadata({
apiKey: 'YOUR_API_KEY',
});
const batchResults = await supadata.youtube.batch.getBatchResults(JOB_ID);
console.log(batchResults);from supadata import Supadata, SupadataError
supadata = Supadata(api_key="YOUR_API_KEY")
batch_results = supadata.youtube.batch.get_batch_results(job_id=JOB_ID)
print(batch_results)curl -X GET "https://api.supadata.ai/v1/youtube/batch/JOB_ID" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json"const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.supadata.ai/v1/youtube/batch/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.supadata.ai/v1/youtube/batch/{jobId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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.supadata.ai/v1/youtube/batch/{jobId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.supadata.ai/v1/youtube/batch/{jobId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.supadata.ai/v1/youtube/batch/{jobId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "completed",
"results": [
{
"videoId": "dQw4w9WgXcQ",
"transcript": {
"content": [
{
"text": "Never gonna give you up...",
"offset": 8150,
"duration": 1200,
"lang": "en"
}
],
"lang": "en",
"availableLangs": [
"en",
"es",
"zh-TW"
]
},
"video": {
"id": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Music Video)",
"description": "The official music video for \"Never Gonna Give You Up\"...",
"duration": 213,
"channel": {
"id": "UCuAXFkgsw1L7xaCfnd5JJOw",
"name": "Rick Astley"
},
"tags": [
"Rick Astley",
"Official Video",
"Music"
],
"transcriptLanguages": [
"en",
"es",
"fr"
],
"thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/hqdefault.jpg",
"uploadDate": "2009-10-25T00:00:00.000Z",
"viewCount": 1234567890,
"likeCount": 12345678
},
"errorCode": "not-found"
}
],
"stats": {
"total": 10,
"succeeded": 8,
"failed": 2
},
"errorCode": "job-expired",
"completedAt": "2025-04-03T06:59:53.428Z"
}{
"error": "invalid-request",
"message": "Invalid Request",
"details": "The request is invalid or malformed",
"documentationUrl": "https://docs.supadata.ai/errors#invalid-request"
}{
"error": "invalid-request",
"message": "Invalid Request",
"details": "The request is invalid or malformed",
"documentationUrl": "https://docs.supadata.ai/errors#invalid-request"
}{
"error": "invalid-request",
"message": "Invalid Request",
"details": "The request is invalid or malformed",
"documentationUrl": "https://docs.supadata.ai/errors#invalid-request"
}Authorizations
Path Parameters
The batch job ID
Query Parameters
Return at most this many results (with offset, pages through a completed batch). Omit both to receive all results in one streamed response.
Required range:
1 <= x <= 500Skip this many results (in submission order) before returning a page.
Required range:
x >= 0Response
Successfully retrieved the status and results (if completed)
Response for batch job results
Current status of the batch job
Available options:
queued, active, completed, failed Example:
"completed"
Array of results for each video in the batch
Show child attributes
Show child attributes
Statistics about the batch job progress
Show child attributes
Show child attributes
Set to job-expired when the batch aged out before finishing; its results are no longer available.
Available options:
job-expired Example:
"job-expired"
Timestamp when the job completed, if status is completed
Example:
"2025-04-03T06:59:53.428Z"
Was this page helpful?