Skip to main content
GET
/
api
/
v2
/
analytics
/
test-runs
Test-run analytics
curl --request GET \
  --url https://api.empirical.run/api/v2/analytics/test-runs \
  --header 'Authorization: Bearer <token>'
{
  "data": {
    "daily": [
      {
        "date": "<string>",
        "run_count": 123,
        "passed_runs": 123,
        "failed_runs": 123,
        "error_runs": 123,
        "cancelled_runs": 123,
        "rerun_count": 123,
        "total_tests": 123,
        "passed_tests": 123,
        "failed_tests": 123,
        "failed_tests_after_snooze": 123,
        "flaky_tests": 123
      }
    ],
    "summary": {
      "total_runs": 123,
      "passed_runs": 123,
      "failed_runs": 123,
      "error_runs": 123,
      "pass_rate": 123,
      "avg_tests_per_run": 123,
      "rerun_count": 123,
      "rerun_rate": 123
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

days
integer

Number of days to include (1-90). Ignored when both start_date and end_date are provided.

Required range: 1 <= x <= 90
start_date
string

Start of a custom date range (ISO 8601).

end_date
string

End of a custom date range (ISO 8601).

environment_id
integer

Filter to a single environment by ID.

Required range: x >= 1
branch
string

Filter to test runs on this git branch.

Response

Daily test-run stats and a period summary.

data
object
required

Response payload.