Count findings matching the list filters, by severity, state and repository
curl --request GET \
--url https://api.hacktron.ai/v1/findings/counts \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.hacktron.ai/v1/findings/counts"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.hacktron.ai/v1/findings/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.hacktron.ai/v1/findings/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 => [
"X-Api-Key: <api-key>"
],
]);
$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.hacktron.ai/v1/findings/counts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.hacktron.ai/v1/findings/counts")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/findings/counts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total": 123,
"by_severity": {
"critical": 123,
"high": 123,
"medium": 123,
"low": 123,
"info": 123
},
"by_state": {
"open": 123,
"true_positive": 123,
"false_positive": 123,
"accepted_risk": 123,
"resolved": 123,
"closed": 123
},
"by_repository": [
{
"repository": "<string>",
"total": 123,
"by_severity": {
"critical": 123,
"high": 123,
"medium": 123,
"low": 123,
"info": 123
}
}
]
}Findings
Count findings
Count findings by severity, state and repository.
Listen to this pageabout 1 min
GET
/
findings
/
counts
Count findings matching the list filters, by severity, state and repository
curl --request GET \
--url https://api.hacktron.ai/v1/findings/counts \
--header 'X-Api-Key: <api-key>'import requests
url = "https://api.hacktron.ai/v1/findings/counts"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://api.hacktron.ai/v1/findings/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.hacktron.ai/v1/findings/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 => [
"X-Api-Key: <api-key>"
],
]);
$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.hacktron.ai/v1/findings/counts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
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.hacktron.ai/v1/findings/counts")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hacktron.ai/v1/findings/counts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"total": 123,
"by_severity": {
"critical": 123,
"high": 123,
"medium": 123,
"low": 123,
"info": 123
},
"by_state": {
"open": 123,
"true_positive": 123,
"false_positive": 123,
"accepted_risk": 123,
"resolved": 123,
"closed": 123
},
"by_repository": [
{
"repository": "<string>",
"total": 123,
"by_severity": {
"critical": 123,
"high": 123,
"medium": 123,
"low": 123,
"info": 123
}
}
]
}Counts findings using the same filters as List findings, without requiring you to fetch every page. The response includes the total and counts by severity, state and repository. Severity and state counts include zero values. Repositories appear in order of finding count, highest first.
Scope required:
readAuthorizations
Query Parameters
Available options:
critical, high, medium, low, info Available options:
open, true_positive, false_positive, accepted_risk, resolved, closed Filter by scan type across all scans associated with the finding.
Available options:
pr, full Filter by repository URL. Case-insensitive; a trailing slash or .git suffix is ignored.
Only include findings discovered on/after this ISO 8601 timestamp.
Only include findings discovered before this ISO 8601 timestamp.
Was this page helpful?
⌘I