curl --request GET \
--url https://stage-api.getswitch.io/copilot/station-based/{provider}/summary_metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/station-based/{provider}/summary_metrics"
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}/summary_metrics', 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}/summary_metrics"
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))
}{
"avg_availability": 6.8,
"ebike_ratio": 31.5,
"peak_shortage_hour": 8,
"problematic_stations_count": 27,
"shortage_rate": 14.2,
"total_stations": 312
}Get Station Summary Metrics
Retrieve an executive summary of key performance indicators for a station-based mobility provider. Returns system-wide metrics including total station count, average vehicle availability, shortage rate, e-bike ratio, peak shortage hour, and the number of problematic stations.
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}/summary_metrics \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/station-based/{provider}/summary_metrics"
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}/summary_metrics', 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}/summary_metrics"
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))
}{
"avg_availability": 6.8,
"ebike_ratio": 31.5,
"peak_shortage_hour": 8,
"problematic_stations_count": 27,
"shortage_rate": 14.2,
"total_stations": 312
}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
Summary metrics retrieved. Returns an executive summary with station count, availability rates, shortage metrics, and peak shortage timing.
Executive summary of station-based system metrics.
Note: shortage_rate and ebike_ratio are scaled ×100 (so 12.3
means 12.3%). This matches the legacy gbfs-based contract.
