curl --request POST \
--url https://api.getswitch.io/operations/imbalance/geojson \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"grid": {
"grid_type": "squares",
"location": "milan",
"tile_size": 1000
},
"prediction_horizon_size": 3,
"time_granularity_minutes": 60
}
'import requests
url = "https://api.getswitch.io/operations/imbalance/geojson"
payload = {
"grid": {
"grid_type": "squares",
"location": "milan",
"tile_size": 1000
},
"prediction_horizon_size": 3,
"time_granularity_minutes": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
grid: {grid_type: 'squares', location: 'milan', tile_size: 1000},
prediction_horizon_size: 3,
time_granularity_minutes: 60
})
};
fetch('https://api.getswitch.io/operations/imbalance/geojson', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getswitch.io/operations/imbalance/geojson"
payload := strings.NewReader("{\n \"grid\": {\n \"grid_type\": \"squares\",\n \"location\": \"milan\",\n \"tile_size\": 1000\n },\n \"prediction_horizon_size\": 3,\n \"time_granularity_minutes\": 60\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"geojson": {
"features": [
{
"geometry": {
"coordinates": [
[
[
9.18,
45.46
],
[
9.1928,
45.46
],
[
9.1928,
45.469
],
[
9.18,
45.469
],
[
9.18,
45.46
]
]
],
"type": "Polygon"
},
"properties": {
"zone_id": "1042",
"imbalance": [
2.5,
1,
-0.5
]
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
[
[
9.1928,
45.46
],
[
9.2056,
45.46
],
[
9.2056,
45.469
],
[
9.1928,
45.469
],
[
9.1928,
45.46
]
]
],
"type": "Polygon"
},
"properties": {
"zone_id": "1043",
"imbalance": [
-1.8,
-3.2,
-2.1
]
},
"type": "Feature"
}
],
"type": "FeatureCollection"
},
"periods": [
"2026-11-30T08:00:00Z",
"2026-11-30T09:00:00Z",
"2026-11-30T10:00:00Z"
]
}Get Imbalance Snapshot as GeoJSON
Calculate and retrieve vehicle distribution imbalance as GeoJSON format for zones within a specified time range. This endpoint returns the same imbalance calculations as the standard imbalance endpoint but merged with spatial grid geometries in GeoJSON format for visualization purposes.
Imbalance is defined as the difference between actual deployed vehicles and forecasted demand per zone, helping identify zones with high demand and low supply for resource allocation optimization.
Failure Modes:
- 400: Location, granularity or grid not enabled for your company
- 401: Invalid or missing authentication credentials
- 403: Insufficient permissions
- 404: Your company has no fleet or forecasts configured
- 422: Invalid request data that fails validation
- 500: Prediction data unavailable, configuration not loaded, or provider communication failure
- 501: Unsupported provider specified in configuration
Required Auth Scopes:
imbalance:read
curl --request POST \
--url https://api.getswitch.io/operations/imbalance/geojson \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"grid": {
"grid_type": "squares",
"location": "milan",
"tile_size": 1000
},
"prediction_horizon_size": 3,
"time_granularity_minutes": 60
}
'import requests
url = "https://api.getswitch.io/operations/imbalance/geojson"
payload = {
"grid": {
"grid_type": "squares",
"location": "milan",
"tile_size": 1000
},
"prediction_horizon_size": 3,
"time_granularity_minutes": 60
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
grid: {grid_type: 'squares', location: 'milan', tile_size: 1000},
prediction_horizon_size: 3,
time_granularity_minutes: 60
})
};
fetch('https://api.getswitch.io/operations/imbalance/geojson', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.getswitch.io/operations/imbalance/geojson"
payload := strings.NewReader("{\n \"grid\": {\n \"grid_type\": \"squares\",\n \"location\": \"milan\",\n \"tile_size\": 1000\n },\n \"prediction_horizon_size\": 3,\n \"time_granularity_minutes\": 60\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"geojson": {
"features": [
{
"geometry": {
"coordinates": [
[
[
9.18,
45.46
],
[
9.1928,
45.46
],
[
9.1928,
45.469
],
[
9.18,
45.469
],
[
9.18,
45.46
]
]
],
"type": "Polygon"
},
"properties": {
"zone_id": "1042",
"imbalance": [
2.5,
1,
-0.5
]
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
[
[
9.1928,
45.46
],
[
9.2056,
45.46
],
[
9.2056,
45.469
],
[
9.1928,
45.469
],
[
9.1928,
45.46
]
]
],
"type": "Polygon"
},
"properties": {
"zone_id": "1043",
"imbalance": [
-1.8,
-3.2,
-2.1
]
},
"type": "Feature"
}
],
"type": "FeatureCollection"
},
"periods": [
"2026-11-30T08:00:00Z",
"2026-11-30T09:00:00Z",
"2026-11-30T10:00:00Z"
]
}Authorizations
Body
Defines the filters applicable to an imbalance snapshot request.
This schema includes parameters such as location, time granularity, prediction horizon, and grid details.
Response
Imbalance snapshot retrieved successfully as GeoJSON with spatial geometries and zone-wise imbalance data.
Represents the GeoJSON response structure for an imbalance snapshot.
This schema includes the GeoJSON representation of zones with their imbalance values and the corresponding time periods.
GeoJSON FeatureCollection with one Polygon feature per zone; each feature's properties are zone_id and imbalance (one value per entry of periods).
{
"features": [
{
"geometry": {
"coordinates": [
[
[9.18, 45.46],
[9.1928, 45.46],
[9.1928, 45.469],
[9.18, 45.469],
[9.18, 45.46]
]
],
"type": "Polygon"
},
"properties": {
"zone_id": "1042",
"imbalance": [2.5, 1, -0.5]
},
"type": "Feature"
},
{
"geometry": {
"coordinates": [
[
[9.1928, 45.46],
[9.2056, 45.46],
[9.2056, 45.469],
[9.1928, 45.469],
[9.1928, 45.46]
]
],
"type": "Polygon"
},
"properties": {
"zone_id": "1043",
"imbalance": [-1.8, -3.2, -2.1]
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}
