Test-count analytics
curl --request GET \
--url https://api.empirical.run/api/v2/analytics/test-count \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.empirical.run/api/v2/analytics/test-count"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.empirical.run/api/v2/analytics/test-count', 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.empirical.run/api/v2/analytics/test-count",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.empirical.run/api/v2/analytics/test-count"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.empirical.run/api/v2/analytics/test-count")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.empirical.run/api/v2/analytics/test-count")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"daily": [
{
"date": "<string>",
"test_count": 123
}
],
"summary": {
"latest_count": 123,
"first_count": 123,
"change": 123,
"change_percent": 123
}
}
}{
"data": "<unknown>",
"error": {
"message": "<string>"
}
}{
"error": "<string>"
}Analytics
Test-count analytics
Returns the number of distinct test cases run per day for the scoped project.
GET
/
api
/
v2
/
analytics
/
test-count
Test-count analytics
curl --request GET \
--url https://api.empirical.run/api/v2/analytics/test-count \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.empirical.run/api/v2/analytics/test-count"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.empirical.run/api/v2/analytics/test-count', 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.empirical.run/api/v2/analytics/test-count",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.empirical.run/api/v2/analytics/test-count"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.empirical.run/api/v2/analytics/test-count")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.empirical.run/api/v2/analytics/test-count")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"daily": [
{
"date": "<string>",
"test_count": 123
}
],
"summary": {
"latest_count": 123,
"first_count": 123,
"change": 123,
"change_percent": 123
}
}
}{
"data": "<unknown>",
"error": {
"message": "<string>"
}
}{
"error": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Number of days to include (1-90). Ignored when both start_date and end_date are provided.
Required range:
1 <= x <= 90Start of a custom date range (ISO 8601).
End of a custom date range (ISO 8601).
Filter to a single environment by ID.
Response
Daily distinct test counts and a period summary.
Response payload.
Show child attributes
Show child attributes
Was this page helpful?
⌘I