curl --request GET \
--url https://stage-api.getswitch.io/copilot/station-based/{provider}/deployment_windows \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/station-based/{provider}/deployment_windows"
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/station-based/{provider}/deployment_windows', 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/station-based/{provider}/deployment_windows"
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))
}{
"optimal_hours": [
7,
8
],
"station_metrics": [
{
"avg_capacity": 30,
"avg_shortage_rate": 0.34,
"avg_vehicles_available": 3.1,
"deployment_priority": "High",
"ebike_ratio": 0.28,
"station_id": 245,
"station_latitude": 45.4859,
"station_longitude": 9.2045,
"station_name": "Stazione Centrale",
"total_observations": 8928
},
{
"avg_capacity": 24,
"avg_shortage_rate": 0.12,
"avg_vehicles_available": 8.6,
"deployment_priority": "Low",
"ebike_ratio": 0.35,
"station_id": 101,
"station_latitude": 45.4642,
"station_longitude": 9.19,
"station_name": "Duomo",
"total_observations": 8928
}
],
"system_shortage_by_hour": [
{
"hour": 7,
"is_weekend": false,
"shortage_rate": 0.18
},
{
"hour": 8,
"is_weekend": false,
"shortage_rate": 0.24
}
],
"window_stats": {
"avg_shortage_rate": 0.14,
"deployment_efficiency": 0.86,
"optimal_end_hour": 8,
"optimal_start_hour": 7
}
}Get Deployment Window Optimization
Analyze optimal times to deploy vehicles by identifying hourly shortage patterns across the network. Returns recommended deployment windows, shortage rates by hour, station-level deployment priority metrics, and efficiency scores.
Use this to schedule vehicle deployment and rebalancing at the most impactful times.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions
- 404:
no_data_bindingwhen the provider or location is not enabled for your company, or no data for that location and period - 422: Invalid filter parameters
- 500: Internal server error
Required Auth Scopes:
copilot:analytics
curl --request GET \
--url https://stage-api.getswitch.io/copilot/station-based/{provider}/deployment_windows \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/station-based/{provider}/deployment_windows"
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/station-based/{provider}/deployment_windows', 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/station-based/{provider}/deployment_windows"
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))
}{
"optimal_hours": [
7,
8
],
"station_metrics": [
{
"avg_capacity": 30,
"avg_shortage_rate": 0.34,
"avg_vehicles_available": 3.1,
"deployment_priority": "High",
"ebike_ratio": 0.28,
"station_id": 245,
"station_latitude": 45.4859,
"station_longitude": 9.2045,
"station_name": "Stazione Centrale",
"total_observations": 8928
},
{
"avg_capacity": 24,
"avg_shortage_rate": 0.12,
"avg_vehicles_available": 8.6,
"deployment_priority": "Low",
"ebike_ratio": 0.35,
"station_id": 101,
"station_latitude": 45.4642,
"station_longitude": 9.19,
"station_name": "Duomo",
"total_observations": 8928
}
],
"system_shortage_by_hour": [
{
"hour": 7,
"is_weekend": false,
"shortage_rate": 0.18
},
{
"hour": 8,
"is_weekend": false,
"shortage_rate": 0.24
}
],
"window_stats": {
"avg_shortage_rate": 0.14,
"deployment_efficiency": 0.86,
"optimal_end_hour": 8,
"optimal_start_hour": 7
}
}Authorizations
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 station-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
Deployment window data retrieved. Returns optimal deployment windows, hourly shortage patterns, and station-level priority metrics.
Deployment windows analysis response with optimal timing and station metrics.
