Skip to main content
GET
Get Transit Punctuality

Authorizations

Authorization
string
header
required

An API key, sent as Authorization: Bearer <key>. Create one in the SWITCH Copilot under Settings → API keys (needs the API keys permission in your company), or with POST /auth/api-keys. The key is shown once, at creation.

Query Parameters

location
string
required

Transit network location, e.g. milan: one of the locations configured for this transit analysis in your company.

Minimum string length: 1
start_date
string<date>
required

First service day, ISO 8601 date, e.g. 2026-10-01.

end_date
string<date>
required

Last service day, included (ISO 8601 date, e.g. 2026-10-31). Not before start_date; at most 31 days in all.

lines
string[]

Line names to keep, case-insensitive, e.g. lines=1&lines=12; a name covers every route that carries it. Combined with route_ids as a union. Empty = all lines.

Maximum array length: 40
route_ids
string[]

Exact GTFS route_ids to keep, e.g. route_ids=R90. Combined with lines as a union. Empty = all lines.

Maximum array length: 40
direction
integer | null

GTFS direction_id to keep (0 or 1). Omit for both.

Required range: 0 <= x <= 1
hour_from
integer
default:0

First hour of the day to include (0-23, local time of the network), by scheduled time.

Required range: 0 <= x <= 23
hour_to
integer
default:23

Last hour of the day to include (0-23, local time), not before hour_from.

Required range: 0 <= x <= 23
day_type
enum<string>
default:all

Days to keep: all, weekday (Monday to Friday), saturday or sunday.

Available options:
all,
weekday,
saturday,
sunday

Response

Punctuality computed. Summary, breakdowns and coverage.

Stop-event punctuality.

partial_realtime_days caveat: some days in coverage.partial_days have realtime data for only part of the timetable, so their figures cover only the observed hours.

summary
PunctualitySummary · object
required
by_hour
PunctualityGroup · object[]
required
by_line
PunctualityGroup · object[]
required
by_stop
PunctualityGroup · object[]
required
by_day
PunctualityGroup · object[]
required
coverage
Coverage · object
required

Requested days vs days with realtime data.

partial_days are days with data whose realtime feed covers only part of the timetable (see _partial_days); they are also days with data. The trip-share part of that rule is relative to the requested range: it compares each day with the median day of the same request, so a range made only of equally thin days is not flagged by it.

definition
Definition · object
required
caveats
string[]