curl --request GET \
--url https://api.shovels.ai/v2/contractors/{id}/metrics \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.shovels.ai/v2/contractors/{id}/metrics"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://api.shovels.ai/v2/contractors/{id}/metrics")
.header("X-API-Key", "<api-key>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.shovels.ai/v2/contractors/{id}/metrics"
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))
}require 'uri'
require 'net/http'
url = URI("https://api.shovels.ai/v2/contractors/{id}/metrics")
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<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shovels.ai/v2/contractors/{id}/metrics",
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;
}{
"items": [
{
"property_type": "residential",
"date": "2022-01-01",
"tag": "solar",
"permit_count": 10,
"avg_job_value": 1000000,
"total_job_value": 10000000,
"avg_construction_duration": 100,
"avg_inspection_pass_rate": 95
},
{
"property_type": "residential",
"date": "2022-02-01",
"tag": "solar",
"permit_count": 4,
"avg_job_value": 1000000,
"total_job_value": 10000000,
"avg_construction_duration": 30,
"avg_inspection_pass_rate": 45
}
],
"size": 2,
"next_cursor": "eyJkYXRlIjoi"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Get Filtered Metrics By Contractor Id
Returns contractor monthly metrics filtered by contractor ID, property type, and tags. Metrics include permit count, average duration, and average pass rate.
curl --request GET \
--url https://api.shovels.ai/v2/contractors/{id}/metrics \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.shovels.ai/v2/contractors/{id}/metrics"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.get("https://api.shovels.ai/v2/contractors/{id}/metrics")
.header("X-API-Key", "<api-key>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.shovels.ai/v2/contractors/{id}/metrics"
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))
}require 'uri'
require 'net/http'
url = URI("https://api.shovels.ai/v2/contractors/{id}/metrics")
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<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shovels.ai/v2/contractors/{id}/metrics",
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;
}{
"items": [
{
"property_type": "residential",
"date": "2022-01-01",
"tag": "solar",
"permit_count": 10,
"avg_job_value": 1000000,
"total_job_value": 10000000,
"avg_construction_duration": 100,
"avg_inspection_pass_rate": 95
},
{
"property_type": "residential",
"date": "2022-02-01",
"tag": "solar",
"permit_count": 4,
"avg_job_value": 1000000,
"total_job_value": 10000000,
"avg_construction_duration": 30,
"avg_inspection_pass_rate": 45
}
],
"size": 2,
"next_cursor": "eyJkYXRlIjoi"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Filter by the specified contractor ID.
Query Parameters
Start date for metrics (inclusive)
End date for metrics (inclusive)
Filter by property type
Filter by tag
Cursor for pagination
1 <= x <= 100Response
Contractor monthly metrics
Schema for cursor-paginated contractors metrics response.
The list of items returned in the response following given criteria.
Show child attributes
Show child attributes
The number of items returned in the response.
The cursor for retrieving the next page of results.
Total result count (capped at 10,000). Present on first-page responses when include_count=true. null if the count query timed out.
Show child attributes
Show child attributes
Was this page helpful?

