Get Live Transit Status
curl --request GET \
--url https://stage-api.getswitch.io/copilot/live/transit/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/live/transit/status"
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/live/transit/status', 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/live/transit/status"
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))
}{
"alerts": [
{
"active_from": "2026-11-25T05:00:00Z",
"active_until": "2026-12-05T23:00:00Z",
"alert_id": "alert-5531",
"description": "The Piazzale Lodi stop is moved 50 m for roadworks.",
"effect": "STOP_MOVED",
"header": "Stop moved",
"route_short_names": [
"90"
],
"severity": "WARNING",
"stop_names": [
"Piazzale Lodi"
]
}
],
"dropped_stale_positions": 1,
"feed_timestamp": "2026-11-29T09:14:58Z",
"generated_at": "2026-11-29T09:15:02Z",
"lines_delay": [
{
"average_delay_seconds": 245,
"route_id": "R90",
"route_short_name": "90",
"vehicles": 1
},
{
"average_delay_seconds": 35,
"route_id": "R73",
"route_short_name": "73",
"vehicles": 1
}
],
"location": "milan",
"on_time_window_seconds": [
-60,
180
],
"schedule_snapshot": "2026-11-28T03:00:00Z",
"summary": {
"early": 0,
"in_service": 2,
"late": 1,
"on_time": 1,
"on_time_pct": 50,
"unknown": 0,
"unknown_share_pct": 0,
"very_late": 0
},
"trip_updates_age_seconds": 18,
"trip_updates_stale": false,
"vehicles": [
{
"bearing": 84,
"bucket": "late",
"delay_reason": "",
"delay_seconds": 245,
"direction_id": 0,
"headsign": "Lotto",
"label": "2207",
"latitude": 45.4781,
"license_plate": "FX123AB",
"longitude": 9.1913,
"next_stop_id": "S1123",
"next_stop_name": "Piazzale Lodi",
"occupancy_status": "MANY_SEATS_AVAILABLE",
"position_age_seconds": 12,
"route_color": "C8102E",
"route_id": "R90",
"route_short_name": "90",
"speed_kmh": 21.6,
"stale": false,
"trip_id": "T90-0815-0",
"vehicle_id": "bus-2207"
},
{
"bearing": 270,
"bucket": "on_time",
"delay_reason": "",
"delay_seconds": 35,
"direction_id": 1,
"headsign": "Duomo",
"label": "1180",
"latitude": 45.4699,
"license_plate": "FX456CD",
"longitude": 9.2101,
"next_stop_id": "S2041",
"next_stop_name": "Corso XXII Marzo",
"occupancy_status": "FEW_SEATS_AVAILABLE",
"position_age_seconds": 20,
"route_color": "0072CE",
"route_id": "R73",
"route_short_name": "73",
"speed_kmh": 14.4,
"stale": false,
"trip_id": "T73-0832-1",
"vehicle_id": "bus-1180"
}
]
}Live
Get Live Transit Status
The public-transit vehicles in service in one location right now, from the network’s realtime feed matched with its timetable: position, line, next stop and delay of each vehicle, a punctuality summary, the five lines with the highest average delay, and active service alerts.
Each vehicle’s delay falls in a bucket: early, on_time (inside on_time_window_seconds, by default 1 minute early to 3 minutes late), late (up to 10 minutes), very_late, or unknown when no delay could be computed (delay_reason says why). Positions older than 2 minutes are marked stale; positions older than 15 minutes are dropped and counted in dropped_stale_positions.
Failure Modes:
- 401: Token is missing or invalid
- 403: Insufficient permissions, live transit not enabled, or the location is not configured for it
- 422:
locationis missing or empty - 502: The realtime feed did not answer
- 503: Live transit is not fully configured for the location
Required Auth Scopes:
copilot:live
GET
/
copilot
/
live
/
transit
/
status
Get Live Transit Status
curl --request GET \
--url https://stage-api.getswitch.io/copilot/live/transit/status \
--header 'Authorization: Bearer <token>'import requests
url = "https://stage-api.getswitch.io/copilot/live/transit/status"
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/live/transit/status', 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/live/transit/status"
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))
}{
"alerts": [
{
"active_from": "2026-11-25T05:00:00Z",
"active_until": "2026-12-05T23:00:00Z",
"alert_id": "alert-5531",
"description": "The Piazzale Lodi stop is moved 50 m for roadworks.",
"effect": "STOP_MOVED",
"header": "Stop moved",
"route_short_names": [
"90"
],
"severity": "WARNING",
"stop_names": [
"Piazzale Lodi"
]
}
],
"dropped_stale_positions": 1,
"feed_timestamp": "2026-11-29T09:14:58Z",
"generated_at": "2026-11-29T09:15:02Z",
"lines_delay": [
{
"average_delay_seconds": 245,
"route_id": "R90",
"route_short_name": "90",
"vehicles": 1
},
{
"average_delay_seconds": 35,
"route_id": "R73",
"route_short_name": "73",
"vehicles": 1
}
],
"location": "milan",
"on_time_window_seconds": [
-60,
180
],
"schedule_snapshot": "2026-11-28T03:00:00Z",
"summary": {
"early": 0,
"in_service": 2,
"late": 1,
"on_time": 1,
"on_time_pct": 50,
"unknown": 0,
"unknown_share_pct": 0,
"very_late": 0
},
"trip_updates_age_seconds": 18,
"trip_updates_stale": false,
"vehicles": [
{
"bearing": 84,
"bucket": "late",
"delay_reason": "",
"delay_seconds": 245,
"direction_id": 0,
"headsign": "Lotto",
"label": "2207",
"latitude": 45.4781,
"license_plate": "FX123AB",
"longitude": 9.1913,
"next_stop_id": "S1123",
"next_stop_name": "Piazzale Lodi",
"occupancy_status": "MANY_SEATS_AVAILABLE",
"position_age_seconds": 12,
"route_color": "C8102E",
"route_id": "R90",
"route_short_name": "90",
"speed_kmh": 21.6,
"stale": false,
"trip_id": "T90-0815-0",
"vehicle_id": "bus-2207"
},
{
"bearing": 270,
"bucket": "on_time",
"delay_reason": "",
"delay_seconds": 35,
"direction_id": 1,
"headsign": "Duomo",
"label": "1180",
"latitude": 45.4699,
"license_plate": "FX456CD",
"longitude": 9.2101,
"next_stop_id": "S2041",
"next_stop_name": "Corso XXII Marzo",
"occupancy_status": "FEW_SEATS_AVAILABLE",
"position_age_seconds": 20,
"route_color": "0072CE",
"route_id": "R73",
"route_short_name": "73",
"speed_kmh": 14.4,
"stale": false,
"trip_id": "T73-0832-1",
"vehicle_id": "bus-1180"
}
]
}Authorizations
HTTPBearerHTTPBearer
Query Parameters
Response
Transit status retrieved. Vehicles, summary, alerts.
