curl --request GET \
--url https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts', 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.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts",
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.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts"
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.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts")
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": {
"total": 42,
"level": {
"high": 3,
"medium": 30,
"low": 9,
"note": 0,
"fmt": 0
},
"category": {
"bug": 2,
"vulnerability": 1,
"structure": 4,
"duplication": 6,
"security_hotspot": 0,
"performance": 0,
"documentation": 0,
"type_check": 3,
"style": 0,
"anti_pattern": 0,
"accessibility": 0,
"dead_code": 0,
"lint": 26,
"secret": 0,
"dependency_alert": 0,
"unspecified": 0
}
},
"meta": {
"analyzedAt": "2026-01-09T12:00:00Z"
}
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}Count issues
Count the issues on a Project’s default branch in total, by level and by category. Every level and category is present, with 0 when no issue has it. The counts come from the latest analysis of the default branch, with ignores applied at request time, and meta.analyzedAt says when that analysis ran; when the default branch has no analysis, data and meta.analyzedAt are null. Narrow the counts with tool and status, which work as they do on List issues; status defaults to open. A request that passes level or category is refused with 400, because the counts already cover every level and category. The counts are available only as JSON: a request whose Accept header does not accept application/json, including one for the .csv or .ndjson extension, is refused with 406. The issue metrics from Get project metrics are values stored when an analysis finished, so they can differ from these counts after someone ignores an issue, while an analysis is still loading, and after an analysis whose load never finished, until the next analysis of the default branch completes.
curl --request GET \
--url https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts', 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.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts",
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.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts"
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.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qlty.sh/gh/{ownerKeyOrId}/projects/{projectKeyOrId}/issues/counts")
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": {
"total": 42,
"level": {
"high": 3,
"medium": 30,
"low": 9,
"note": 0,
"fmt": 0
},
"category": {
"bug": 2,
"vulnerability": 1,
"structure": 4,
"duplication": 6,
"security_hotspot": 0,
"performance": 0,
"documentation": 0,
"type_check": 3,
"style": 0,
"anti_pattern": 0,
"accessibility": 0,
"dead_code": 0,
"lint": 26,
"secret": 0,
"dependency_alert": 0,
"unspecified": 0
}
},
"meta": {
"analyzedAt": "2026-01-09T12:00:00Z"
}
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}{
"errors": [
{
"status": "400",
"title": "Bad Request",
"detail": "The request was invalid."
}
]
}Authorizations
Generate an API token at https://qlty.sh/user/settings/tokens