Skip to main content
GET
https://api.tornadoapi.io
/
dashboard
/
stats
Dashboard Stats
curl --request GET \
  --url https://api.tornadoapi.io/dashboard/stats \
  --header 'x-api-key: <x-api-key>'
{
  "total_jobs": 1523,
  "pending_jobs": 5,
  "processing_jobs": 12,
  "completed_jobs": 1450,
  "failed_jobs": 56,
  "storage_used_bytes": 53687091200,
  "storage_used_gb": 50.0,
  "client_name": "My Application",
  "avg_processing_time_seconds": 45.2,
  "today_throughput_bytes": 1073741824
}

Overview

Returns aggregated job statistics for the dashboard, including counts by status and storage usage.

Header Parameters

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

Response

total_jobs
integer
Total number of jobs created
pending_jobs
integer
Jobs waiting in queue
processing_jobs
integer
Jobs currently being processed
completed_jobs
integer
Successfully completed jobs
failed_jobs
integer
Jobs that encountered errors
storage_used_bytes
integer
Total storage used in bytes
storage_used_gb
number
Total storage used in gigabytes
client_name
string
Your account/client name
avg_processing_time_seconds
number
Average job processing time in seconds (last 24 hours). null if no completed jobs.
today_throughput_bytes
integer
Total bytes downloaded today

Example

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

Success Response

{
  "total_jobs": 1523,
  "pending_jobs": 5,
  "processing_jobs": 12,
  "completed_jobs": 1450,
  "failed_jobs": 56,
  "storage_used_bytes": 53687091200,
  "storage_used_gb": 50.0,
  "client_name": "My Application",
  "avg_processing_time_seconds": 45.2,
  "today_throughput_bytes": 1073741824
}

Error Responses

{
  "error": "Missing x-api-key header"
}

Usage

This endpoint is used by the web dashboard to populate the stats cards at the top of the page.
async function loadStats(apiKey) {
  const response = await fetch('/dashboard/stats', {
    headers: { 'x-api-key': apiKey }
  });
  const stats = await response.json();

  document.getElementById('total').textContent = stats.total_jobs;
  document.getElementById('completed').textContent = stats.completed_jobs;
  document.getElementById('failed').textContent = stats.failed_jobs;
  document.getElementById('processing').textContent =
    stats.pending_jobs + stats.processing_jobs;
  document.getElementById('storage').textContent =
    stats.storage_used_gb.toFixed(2) + ' GB';
}