Get Batch Status
curl --request GET \
--url https://api.tornadoapi.io/batch/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.tornadoapi.io/batch/{id}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.tornadoapi.io/batch/{id}', 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.tornadoapi.io/batch/{id}",
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: <x-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.tornadoapi.io/batch/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-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.tornadoapi.io/batch/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/batch/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440001",
"show_url": "https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX",
"status": "completed",
"folder": "huberman-lab-2024",
"total_episodes": 142,
"completed_episodes": 142,
"failed_episodes": 0,
"skipped_episodes": 0,
"episode_jobs": ["uuid-1", "uuid-2", "uuid-3"]
}
Batch Operations
Get Batch Status
Get the status of a Spotify show batch download
GET
/
batch
/
{id}
Get Batch Status
curl --request GET \
--url https://api.tornadoapi.io/batch/{id} \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.tornadoapi.io/batch/{id}"
headers = {"x-api-key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
fetch('https://api.tornadoapi.io/batch/{id}', 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.tornadoapi.io/batch/{id}",
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: <x-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.tornadoapi.io/batch/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<x-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.tornadoapi.io/batch/{id}")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tornadoapi.io/batch/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440001",
"show_url": "https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX",
"status": "completed",
"folder": "huberman-lab-2024",
"total_episodes": 142,
"completed_episodes": 142,
"failed_episodes": 0,
"skipped_episodes": 0,
"episode_jobs": ["uuid-1", "uuid-2", "uuid-3"]
}
Overview
Retrieves the current status and progress of a batch download operation.Header Parameters
string
required
Your API key for authentication
Path Parameters
string
required
The batch UUID returned from
POST /jobs when submitting a Spotify show URLResponse
string
Batch UUID
string
Original Spotify show URL
string
Batch status:
paused, processing, completed, or finishedstring
S3 folder prefix for episodes
integer
Total number of episodes in the show
integer
Number of successfully completed episodes
integer
Number of failed episodes
integer
Number of skipped episodes (e.g. audio-only Spotify episodes protected by Widevine DRM)
array
List of individual job UUIDs for each episode
Example
curl -X GET "https://api.tornadoapi.io/batch/550e8400-e29b-41d4-a716-446655440001" \
-H "x-api-key: sk_your_api_key"
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"show_url": "https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX",
"status": "processing",
"folder": "huberman-lab-2024",
"total_episodes": 142,
"completed_episodes": 45,
"failed_episodes": 2,
"episode_jobs": ["uuid-1", "uuid-2", "uuid-3", "..."]
}
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"show_url": "https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX",
"status": "completed",
"folder": "huberman-lab-2024",
"total_episodes": 142,
"completed_episodes": 142,
"failed_episodes": 0,
"episode_jobs": ["uuid-1", "uuid-2", "..."]
}
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"show_url": "https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX",
"status": "finished",
"folder": "huberman-lab-2024",
"total_episodes": 142,
"completed_episodes": 140,
"failed_episodes": 2,
"episode_jobs": ["uuid-1", "uuid-2", "..."]
}
Status Values
| Status | Meaning |
|---|---|
paused | Batch created with paused: true, waiting for POST /batch/{id}/start |
processing | Batch is in progress, episodes are being downloaded |
completed | All episodes finished successfully (0 failures) |
finished | All episodes done, but some failed |
Progress Calculation
Progress = (completed_episodes + failed_episodes) / total_episodes * 100
completed_episodes + failed_episodes >= total_episodes
Polling Example
import requests
import time
def wait_for_batch(batch_id, api_key):
while True:
response = requests.get(
f"https://api.tornadoapi.io/batch/{batch_id}",
headers={"x-api-key": api_key}
)
data = response.json()
completed = data["completed_episodes"]
failed = data["failed_episodes"]
total = data["total_episodes"]
print(f"Progress: {completed + failed}/{total} ({failed} failed)")
if data["status"] in ["completed", "finished"]:
return data
time.sleep(10)
# Usage
result = wait_for_batch("batch-uuid", "sk_your_api_key")
print(f"Final status: {result['status']}")
Success Response
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"show_url": "https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX",
"status": "completed",
"folder": "huberman-lab-2024",
"total_episodes": 142,
"completed_episodes": 142,
"failed_episodes": 0,
"skipped_episodes": 0,
"episode_jobs": ["uuid-1", "uuid-2", "uuid-3"]
}
Error Responses
null
Checking Individual Episodes
To see details about failed episodes, query individual job IDs:curl -X GET "https://api.tornadoapi.io/jobs/{episode_job_id}" \
-H "x-api-key: sk_your_api_key"
Was this page helpful?
⌘I
