Get Zone Shortage Mapping
curl --request GET \
--url https://stage-api.getswitch.io/copilot/zone-based/{provider}/shortage_mapping \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/zone-based/{provider}/shortage_mapping"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.getswitch.io/copilot/zone-based/{provider}/shortage_mapping', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stage-api.getswitch.io/copilot/zone-based/{provider}/shortage_mapping"
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))
}{
"historical_availability": [
{
"avg_availability": 3.7,
"period": "2026-10-01T00:00:00Z"
},
{
"avg_availability": 3.4,
"period": "2026-10-16T00:00:00Z"
}
],
"hourly_patterns": [
{
"day_type": "Weekday",
"hour": 8,
"is_weekend": false,
"shortage_rate": 0.27
},
{
"day_type": "Weekend",
"hour": 8,
"is_weekend": true,
"shortage_rate": 0.19
}
],
"zone_shortage": [
{
"avg_vehicle_count": 1.3,
"context": {
"population": 980,
"top_pois": [
{
"category": "sustenance",
"count": 47
},
{
"category": "leisure",
"count": 6
}
],
"transit_stops_total": 4
},
"geom": {
"coordinates": [
[
[
9.17496,
45.45181
],
[
9.17633,
45.45181
],
[
9.17633,
45.45319
],
[
9.17496,
45.45319
],
[
9.17496,
45.45181
]
]
],
"type": "Polygon"
},
"historical_availability": [
{
"avg_availability": 1.6,
"period": "2026-10-01T00:00:00Z"
},
{
"avg_availability": 1.1,
"period": "2026-10-16T00:00:00Z"
}
],
"shortage_rate": 0.42,
"zone_id": "u0nd8f3",
"zone_label": "u0nd8f3",
"zone_latitude": 45.4525,
"zone_longitude": 9.17564
},
{
"avg_vehicle_count": 8.9,
"context": {
"population": 412,
"top_pois": [
{
"category": "sustenance",
"count": 64
},
{
"category": "shop",
"count": 51
},
{
"category": "tourism",
"count": 12
}
],
"transit_stops_total": 9
},
"geom": {
"coordinates": [
[
[
9.18869,
45.46417
],
[
9.19006,
45.46417
],
[
9.19006,
45.46555
],
[
9.18869,
45.46555
],
[
9.18869,
45.46417
]
]
],
"type": "Polygon"
},
"historical_availability": [
{
"avg_availability": 9.4,
"period": "2026-10-01T00:00:00Z"
},
{
"avg_availability": 8.3,
"period": "2026-10-16T00:00:00Z"
}
],
"shortage_rate": 0.08,
"zone_id": "u0nd9he",
"zone_label": "u0nd9he",
"zone_latitude": 45.46486,
"zone_longitude": 9.18938
}
]
}Zone Based Analytics
Get Zone Shortage Mapping
Per-zone shortage rate (share of hours with no vehicle in the zone), the shortage rate by hour for weekdays and weekends, and the average number of vehicles over time, for the network and per zone.
Failure Modes:
- 400:
precisiongiven with a zoning system other thangeohash7 - 401: Token is missing or invalid
- 403: Insufficient permissions
- 404:
no_data_bindingwhen the provider or location is not enabled for your company - 422: Invalid filter parameters
Required Auth Scopes:
copilot:analytics
GET
/
copilot
/
zone-based
/
{provider}
/
shortage_mapping
Get Zone Shortage Mapping
curl --request GET \
--url https://stage-api.getswitch.io/copilot/zone-based/{provider}/shortage_mapping \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/zone-based/{provider}/shortage_mapping"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://stage-api.getswitch.io/copilot/zone-based/{provider}/shortage_mapping', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://stage-api.getswitch.io/copilot/zone-based/{provider}/shortage_mapping"
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))
}{
"historical_availability": [
{
"avg_availability": 3.7,
"period": "2026-10-01T00:00:00Z"
},
{
"avg_availability": 3.4,
"period": "2026-10-16T00:00:00Z"
}
],
"hourly_patterns": [
{
"day_type": "Weekday",
"hour": 8,
"is_weekend": false,
"shortage_rate": 0.27
},
{
"day_type": "Weekend",
"hour": 8,
"is_weekend": true,
"shortage_rate": 0.19
}
],
"zone_shortage": [
{
"avg_vehicle_count": 1.3,
"context": {
"population": 980,
"top_pois": [
{
"category": "sustenance",
"count": 47
},
{
"category": "leisure",
"count": 6
}
],
"transit_stops_total": 4
},
"geom": {
"coordinates": [
[
[
9.17496,
45.45181
],
[
9.17633,
45.45181
],
[
9.17633,
45.45319
],
[
9.17496,
45.45319
],
[
9.17496,
45.45181
]
]
],
"type": "Polygon"
},
"historical_availability": [
{
"avg_availability": 1.6,
"period": "2026-10-01T00:00:00Z"
},
{
"avg_availability": 1.1,
"period": "2026-10-16T00:00:00Z"
}
],
"shortage_rate": 0.42,
"zone_id": "u0nd8f3",
"zone_label": "u0nd8f3",
"zone_latitude": 45.4525,
"zone_longitude": 9.17564
},
{
"avg_vehicle_count": 8.9,
"context": {
"population": 412,
"top_pois": [
{
"category": "sustenance",
"count": 64
},
{
"category": "shop",
"count": 51
},
{
"category": "tourism",
"count": 12
}
],
"transit_stops_total": 9
},
"geom": {
"coordinates": [
[
[
9.18869,
45.46417
],
[
9.19006,
45.46417
],
[
9.19006,
45.46555
],
[
9.18869,
45.46555
],
[
9.18869,
45.46417
]
]
],
"type": "Polygon"
},
"historical_availability": [
{
"avg_availability": 9.4,
"period": "2026-10-01T00:00:00Z"
},
{
"avg_availability": 8.3,
"period": "2026-10-16T00:00:00Z"
}
],
"shortage_rate": 0.08,
"zone_id": "u0nd9he",
"zone_label": "u0nd9he",
"zone_latitude": 45.46486,
"zone_longitude": 9.18938
}
]
}Authorizations
HTTPBearerHTTPBearer
Path Parameters
Identifier of the mobility provider whose data you analyse, e.g. acme-bikes. It must be the provider of a data source enabled for your company's zone-based analytics; any other value is refused with 404 no_data_binding (kind: source). Your SWITCH contact tells you the provider identifiers and locations enabled for your company.
Query Parameters
Response
Shortage mapping retrieved. Hourly patterns, zone shortage, history.
