curl --request GET \
--url https://stage-api.getswitch.io/copilot/station-based/{provider}/refill_times \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/station-based/{provider}/refill_times"
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}/refill_times', 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}/refill_times"
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))
}{
"hourly_refill": [
{
"avg_refill_time_min": 38.5,
"count": 214,
"hour": 7
},
{
"avg_refill_time_min": 24,
"count": 166,
"hour": 12
}
],
"station_metrics": [
{
"afternoon_refills": 48,
"avg_refill_time_min": 47.3,
"ebike_ratio": 0.28,
"evening_refills": 52,
"max_refill_time_min": 212,
"median_refill_time_min": 35,
"min_refill_time_min": 5,
"morning_refills": 71,
"night_refills": 15,
"peak_hour_ratio": 0.66,
"quick_refill_ratio": 0.42,
"quick_refills_30min": 79,
"refill_consistency_score": 0.45,
"shortage_rate": 0.34,
"slow_refills_60min": 44,
"station_id": 245,
"station_latitude": 45.4859,
"station_longitude": 9.2045,
"station_name": "Stazione Centrale",
"std_refill_time_min": 38.1,
"total_refill_events": 186
}
],
"summary_stats": {
"avg_refill_time": 31.2,
"median_refill_time": 22,
"total_refill_events": 5320
}
}Get Station Refill Time Analysis
Analyze how long stations remain empty and identify slow refill patterns. Returns average refill times by hour and station, stations with the longest shortage durations, refill efficiency metrics, and peak-hour refill ratios.
Use this to optimize rebalancing operations and reduce empty-station downtime.
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}/refill_times \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/station-based/{provider}/refill_times"
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}/refill_times', 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}/refill_times"
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))
}{
"hourly_refill": [
{
"avg_refill_time_min": 38.5,
"count": 214,
"hour": 7
},
{
"avg_refill_time_min": 24,
"count": 166,
"hour": 12
}
],
"station_metrics": [
{
"afternoon_refills": 48,
"avg_refill_time_min": 47.3,
"ebike_ratio": 0.28,
"evening_refills": 52,
"max_refill_time_min": 212,
"median_refill_time_min": 35,
"min_refill_time_min": 5,
"morning_refills": 71,
"night_refills": 15,
"peak_hour_ratio": 0.66,
"quick_refill_ratio": 0.42,
"quick_refills_30min": 79,
"refill_consistency_score": 0.45,
"shortage_rate": 0.34,
"slow_refills_60min": 44,
"station_id": 245,
"station_latitude": 45.4859,
"station_longitude": 9.2045,
"station_name": "Stazione Centrale",
"std_refill_time_min": 38.1,
"total_refill_events": 186
}
],
"summary_stats": {
"avg_refill_time": 31.2,
"median_refill_time": 22,
"total_refill_events": 5320
}
}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
Refill time data retrieved. Returns hourly refill patterns and per-station refill efficiency metrics.
Refill times analysis response with timing and efficiency metrics.
