Skip to main content
GET
/
api
/
v1
/
analytics
/
test-runs
Test Runs
curl --request GET \
  --url https://api.example.com/api/v1/analytics/test-runs \
  --header 'Authorization: <authorization>'
{
  "data": {
    "daily": [
      {
        "date": "2025-02-01",
        "run_count": 5,
        "passed_runs": 4,
        "failed_runs": 1,
        "error_runs": 0,
        "cancelled_runs": 0,
        "rerun_count": 1,
        "total_tests": 750,
        "passed_tests": 720,
        "failed_tests": 20,
        "failed_tests_after_snooze": 15,
        "flaky_tests": 10
      },
      {
        "date": "2025-02-02",
        "run_count": 3,
        "passed_runs": 3,
        "failed_runs": 0,
        "error_runs": 0,
        "cancelled_runs": 0,
        "rerun_count": 0,
        "total_tests": 450,
        "passed_tests": 450,
        "failed_tests": 0,
        "failed_tests_after_snooze": 0,
        "flaky_tests": 2
      }
    ],
    "summary": {
      "total_runs": 45,
      "passed_runs": 40,
      "failed_runs": 5,
      "error_runs": 0,
      "pass_rate": 89,
      "avg_tests_per_run": 150,
      "rerun_count": 3,
      "rerun_rate": 7
    }
  }
}
Returns test run statistics aggregated by day, including run counts, pass/fail breakdown, and test-level metrics.

Examples

Request

Authorization
string
required
Bearer token for authentication. Format: Bearer <your-api-key>
days
number
default:"30"
Number of days of history (1-90). Ignored if start_date and end_date are provided.
start_date
string
Start of custom date range (ISO 8601 format). Must be used together with end_date.
end_date
string
End of custom date range (ISO 8601 format). Must be used together with start_date.
environment_id
string
Filter by environment ID.

Response

data
object
{
  "data": {
    "daily": [
      {
        "date": "2025-02-01",
        "run_count": 5,
        "passed_runs": 4,
        "failed_runs": 1,
        "error_runs": 0,
        "cancelled_runs": 0,
        "rerun_count": 1,
        "total_tests": 750,
        "passed_tests": 720,
        "failed_tests": 20,
        "failed_tests_after_snooze": 15,
        "flaky_tests": 10
      },
      {
        "date": "2025-02-02",
        "run_count": 3,
        "passed_runs": 3,
        "failed_runs": 0,
        "error_runs": 0,
        "cancelled_runs": 0,
        "rerun_count": 0,
        "total_tests": 450,
        "passed_tests": 450,
        "failed_tests": 0,
        "failed_tests_after_snooze": 0,
        "flaky_tests": 2
      }
    ],
    "summary": {
      "total_runs": 45,
      "passed_runs": 40,
      "failed_runs": 5,
      "error_runs": 0,
      "pass_rate": 89,
      "avg_tests_per_run": 150,
      "rerun_count": 3,
      "rerun_rate": 7
    }
  }
}

Get last 30 days of test runs

curl -X GET \
  "https://dash.empirical.run/api/v1/analytics/test-runs?days=30" \
  -H "Authorization: Bearer $EMPIRICALRUN_KEY"