Skip to main content
GET
https://api.tornadoapi.io
/
dashboard
/
batches
Dashboard Batches
curl --request GET \
  --url https://api.tornadoapi.io/dashboard/batches \
  --header 'x-api-key: <x-api-key>'
{
  "batches": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "show_url": "https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX",
      "folder": "huberman-lab-2024",
      "total_episodes": 142,
      "completed_episodes": 140,
      "failed_episodes": 2,
      "status": "finished"
    }
  ]
}

Overview

Returns all Spotify show batch operations for your API key with progress information.

Header Parameters

x-api-key
string
required
Your API key for authentication

Response

batches
array
Array of batch objects
batches[].id
string
Batch UUID
batches[].show_url
string
Spotify show URL
batches[].folder
string
S3 folder prefix for episodes
batches[].total_episodes
integer
Total number of episodes in the show
batches[].completed_episodes
integer
Number of successfully completed episodes
batches[].failed_episodes
integer
Number of failed episodes
batches[].status
string
Batch status: processing, completed, or finished

Example

curl -X GET "https://api.tornadoapi.io/dashboard/batches" \
  -H "x-api-key: sk_your_api_key"

Success Response

{
  "batches": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "show_url": "https://open.spotify.com/show/7iQXmUT7XGuZSzAMjoNWlX",
      "folder": "huberman-lab-2024",
      "total_episodes": 142,
      "completed_episodes": 140,
      "failed_episodes": 2,
      "status": "finished"
    }
  ]
}

Error Responses

{
  "error": "Invalid API Key"
}

Status Values

StatusMeaning
processingBatch is in progress
completedAll episodes finished successfully
finishedAll episodes done, but some failed

Dashboard Usage

async function loadBatches(apiKey) {
  const response = await fetch('/dashboard/batches', {
    headers: { 'x-api-key': apiKey }
  });
  const data = await response.json();

  data.batches.forEach(batch => {
    const done = batch.completed_episodes + batch.failed_episodes;
    const progress = Math.round(done / batch.total_episodes * 100);

    console.log(`${batch.folder}: ${progress}% (${batch.failed_episodes} failed)`);
  });
}

Progress Calculation

function calculateProgress(batch) {
  const done = batch.completed_episodes + batch.failed_episodes;
  return {
    percentage: Math.round(done / batch.total_episodes * 100),
    isComplete: done >= batch.total_episodes,
    hasFailed: batch.failed_episodes > 0
  };
}