{"openapi":"3.0.3","info":{"title":"Przesiadka.com Backend API","description":"GTFS and GTFS-RT API for public transport network state.","version":"0.6.0"},"components":{"schemas":{}},"paths":{"/health":{"get":{"summary":"Check backend and database health","tags":["health"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"db":{"type":"string"},"dataset":{"type":"string"},"version":{"type":"string"},"commit":{"type":"string","nullable":true}},"required":["status","db","dataset","version","commit"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/gtfs/static/status":{"get":{"summary":"Get static GTFS feed status","tags":["static-gtfs"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"object","additionalProperties":true},"recentFeeds":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["status","recentFeeds"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/gtfs/static/sync":{"post":{"summary":"Run static GTFS discovery and import","tags":["static-gtfs"],"description":"Needs Authorization: Bearer <TELEMETRY_ADMIN_TOKEN>; without that token set, 404.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"status":{"type":"string","enum":["completed","skipped"]},"reason":{"type":"string","nullable":true},"checkedAt":{"type":"string","format":"date-time"},"currentFeed":{"type":"string","nullable":true},"nextFeed":{"type":"string","nullable":true},"importedFeed":{"type":"string","nullable":true},"importedSlice":{"type":"string","nullable":true,"description":"The version (16 hex digits) of the part imported apart (the trains) whose rows this sync replaced: with importedFeed, or alone."},"exportedGtfs":{"type":"string","nullable":true,"description":"The version of the GTFS export (GET /open/v1/feeds/<id>/gtfs.zip) written after this sync changed the tables."},"downloadedFeeds":{"type":"array","items":{"type":"string"}}},"required":["datasetId","status","checkedAt","currentFeed","nextFeed","importedFeed","importedSlice","exportedGtfs","downloadedFeeds"]}}}},"202":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"status":{"type":"string","enum":["completed","skipped"]},"reason":{"type":"string","nullable":true},"checkedAt":{"type":"string","format":"date-time"},"currentFeed":{"type":"string","nullable":true},"nextFeed":{"type":"string","nullable":true},"importedFeed":{"type":"string","nullable":true},"importedSlice":{"type":"string","nullable":true,"description":"The version (16 hex digits) of the part imported apart (the trains) whose rows this sync replaced: with importedFeed, or alone."},"exportedGtfs":{"type":"string","nullable":true,"description":"The version of the GTFS export (GET /open/v1/feeds/<id>/gtfs.zip) written after this sync changed the tables."},"downloadedFeeds":{"type":"array","items":{"type":"string"}}},"required":["datasetId","status","checkedAt","currentFeed","nextFeed","importedFeed","importedSlice","exportedGtfs","downloadedFeeds"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/gtfs/realtime/status":{"get":{"summary":"Get GTFS-RT polling status","tags":["realtime-gtfs"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/gtfs/realtime/poll":{"post":{"summary":"Run one GTFS-RT poll","tags":["realtime-gtfs"],"description":"Needs Authorization: Bearer <TELEMETRY_ADMIN_TOKEN>; without that token set, 404.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"feedName":{"type":"string","enum":["vehicle_positions","trip_updates"]},"status":{"type":"string","enum":["success","failed","skipped"]},"feedTimestamp":{"type":"number","nullable":true},"entityCount":{"type":"number"},"storedRows":{"type":"number"},"bytesReceived":{"type":"number"},"durationMs":{"type":"number"},"error":{"type":"string","nullable":true}},"required":["feedName","status","feedTimestamp","entityCount","storedRows","bytesReceived","durationMs"]}}},"required":["results"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/gtfs/realtime/vehicle_positions.pb":{"get":{"summary":"GTFS-RT VehiclePositions emulated from the timetable","tags":["realtime-gtfs"],"description":"Only for datasets without a realtime source; the vehicles of GET /api/vehicles as a protobuf FeedMessage.","responses":{"404":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/service/status":{"get":{"summary":"Whether the network can show anything now","tags":["service"],"description":"Timetable availability, the GTFS-RT feed's health and, for timetable-driven datasets, whether service runs today and the next trip.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"datasetName":{"type":"string"},"generatedAt":{"type":"string"},"timetableAvailable":{"type":"boolean"},"realtime":{"type":"object","properties":{"source":{"type":"string","enum":["feed","schedule","none"]},"state":{"type":"string","enum":["ok","down"]},"lastDataAt":{"type":"string","nullable":true}},"required":["source","state","lastDataAt"]},"schedule":{"type":"object","nullable":true,"properties":{"date":{"type":"string"},"runsToday":{"type":"boolean"},"vehiclesNow":{"type":"integer"},"nextDeparture":{"type":"object","nullable":true,"properties":{"date":{"type":"string","description":"Local date in the dataset's time zone, YYYY-MM-DD."},"time":{"type":"string","description":"Local time, HH:MM."},"epoch":{"type":"integer"}},"required":["date","time","epoch"]}},"required":["date","runsToday","vehiclesNow","nextDeparture"]}},"required":["datasetId","datasetName","generatedAt","timetableAvailable","realtime","schedule"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/vehicles":{"get":{"summary":"Get current vehicle positions","tags":["vehicles"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"maxAgeSeconds","required":false,"description":"Return vehicles received within this many seconds."},{"schema":{"type":"string"},"in":"query","name":"bbox","required":false,"description":"Bounding box as minLon,minLat,maxLon,maxLat."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"vehicles":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"delaySeconds":{"type":"integer","nullable":true,"description":"Current delay in seconds from GTFS-RT trip updates, positive = late, negative = early, null = unknown."},"trip_short_name":{"type":"string","nullable":true,"description":"A train's number, with its name when it has one (\"77521\", \"10110/1 Łukowiak\"); its replacement bus's too. Only on trains, whose vehicle_id is their trip id, not a fleet number."},"agency_name":{"type":"string","nullable":true,"description":"A train's carrier (\"Koleje Wielkopolskie\"). Only on trains."}}}}},"required":["datasetId","vehicles"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/vehicles/lines":{"get":{"summary":"Get lines that currently have vehicles, with vehicle counts","tags":["vehicles"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"generatedAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["datasetId","generatedAt","lines"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/vehicles/delays":{"get":{"summary":"Get city-wide delay statistics from the live vehicle snapshot","tags":["vehicles"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"generatedAt":{"type":"string"},"thresholds":{"type":"object","properties":{"earlyAtOrBelowSeconds":{"type":"integer"},"lateFromSeconds":{"type":"integer"},"veryLateFromSeconds":{"type":"integer"}},"required":["earlyAtOrBelowSeconds","lateFromSeconds","veryLateFromSeconds"]},"all":{"type":"object","properties":{"vehicleCount":{"type":"integer"},"withDelayCount":{"type":"integer"},"onTimeShare":{"type":"number","nullable":true},"meanDelaySeconds":{"type":"integer","nullable":true},"medianDelaySeconds":{"type":"integer","nullable":true},"buckets":{"type":"object","properties":{"early":{"type":"integer"},"onTime":{"type":"integer"},"late":{"type":"integer"},"veryLate":{"type":"integer"}},"required":["early","onTime","late","veryLate"]}},"required":["vehicleCount","withDelayCount","onTimeShare","meanDelaySeconds","medianDelaySeconds","buckets"]},"trams":{"type":"object","properties":{"vehicleCount":{"type":"integer"},"withDelayCount":{"type":"integer"},"onTimeShare":{"type":"number","nullable":true},"meanDelaySeconds":{"type":"integer","nullable":true},"medianDelaySeconds":{"type":"integer","nullable":true},"buckets":{"type":"object","properties":{"early":{"type":"integer"},"onTime":{"type":"integer"},"late":{"type":"integer"},"veryLate":{"type":"integer"}},"required":["early","onTime","late","veryLate"]}},"required":["vehicleCount","withDelayCount","onTimeShare","meanDelaySeconds","medianDelaySeconds","buckets"]},"buses":{"type":"object","properties":{"vehicleCount":{"type":"integer"},"withDelayCount":{"type":"integer"},"onTimeShare":{"type":"number","nullable":true},"meanDelaySeconds":{"type":"integer","nullable":true},"medianDelaySeconds":{"type":"integer","nullable":true},"buckets":{"type":"object","properties":{"early":{"type":"integer"},"onTime":{"type":"integer"},"late":{"type":"integer"},"veryLate":{"type":"integer"}},"required":["early","onTime","late","veryLate"]}},"required":["vehicleCount","withDelayCount","onTimeShare","meanDelaySeconds","medianDelaySeconds","buckets"]},"worstVehicles":{"type":"array","items":{"type":"object","additionalProperties":true,"properties":{"delaySeconds":{"type":"integer","nullable":true,"description":"Current delay in seconds from GTFS-RT trip updates, positive = late, negative = early, null = unknown."},"trip_short_name":{"type":"string","nullable":true,"description":"A train's number, with its name when it has one (\"77521\", \"10110/1 Łukowiak\"); its replacement bus's too. Only on trains, whose vehicle_id is their trip id, not a fleet number."},"agency_name":{"type":"string","nullable":true,"description":"A train's carrier (\"Koleje Wielkopolskie\"). Only on trains."}}}},"worstLines":{"type":"array","items":{"type":"object","properties":{"routeId":{"type":"string","nullable":true},"routeShortName":{"type":"string"},"routeType":{"type":"integer","nullable":true},"routeColor":{"type":"string","nullable":true},"routeTextColor":{"type":"string","nullable":true},"vehicleCount":{"type":"integer"},"meanDelaySeconds":{"type":"integer"},"maxDelaySeconds":{"type":"integer"}},"required":["routeShortName","vehicleCount","meanDelaySeconds","maxDelaySeconds"]}}},"required":["datasetId","generatedAt","thresholds","all","trams","buses","worstVehicles","worstLines"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/stops":{"get":{"summary":"Get stops within an optional map bounding box","tags":["stops"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"bbox","required":false,"description":"Bounding box as minLon,minLat,maxLon,maxLat."},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Maximum number of stops to return."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"stops":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["datasetId","stops"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/stops/search":{"get":{"summary":"Search stops by name, with disambiguating headsign and lines","tags":["stops"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Search term matched against stop names."},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Maximum number of results to return."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"query":{"type":"string"},"results":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["datasetId","query","results"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/stops/{stopId}/departures":{"get":{"summary":"Get upcoming departures and lines serving a stop","tags":["stops"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Maximum number of upcoming departures to return."},{"schema":{"type":"string"},"in":"query","name":"routeId","required":false,"description":"Only departures of this GTFS route_id."},{"schema":{"type":"string"},"in":"path","name":"stopId","required":true,"description":"GTFS stop_id. URL-encode values containing ^, +, /, or spaces."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"stopId":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"stop":{"type":"object","additionalProperties":true},"lines":{"type":"array","items":{"type":"object","additionalProperties":true}},"departures":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["datasetId","stopId","generatedAt","stop","lines","departures"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/stops/{stopId}/timetable":{"get":{"summary":"Get the full-day timetable of one line at a stop","tags":["stops"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"routeId","required":false,"description":"GTFS route_id (required)."},{"schema":{"type":"string"},"in":"query","name":"date","required":false,"description":"Service date YYYY-MM-DD; default today (Europe/Warsaw)."},{"schema":{"type":"string"},"in":"path","name":"stopId","required":true,"description":"GTFS stop_id. URL-encode values containing ^, +, /, or spaces."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"stopId":{"type":"string"},"routeId":{"type":"string"},"date":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"stop":{"type":"object","nullable":true,"additionalProperties":true},"line":{"type":"object","nullable":true,"additionalProperties":true},"headsigns":{"type":"array","items":{"type":"string"}},"departures":{"type":"array","items":{"type":"object","properties":{"tripId":{"type":"string"},"departureSeconds":{"type":"number"},"time":{"type":"string"},"headsign":{"type":"string","nullable":true},"nextDay":{"type":"boolean"}},"required":["tripId","departureSeconds","time","headsign","nextDay"]}}},"required":["datasetId","stopId","routeId","date","generatedAt","stop","line","headsigns","departures"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/finished-vehicles":{"get":{"summary":"Vehicles that recently ended their run (parked at a loop/depot)","tags":["vehicles"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"bbox","required":false,"description":"Bounding box as minLon,minLat,maxLon,maxLat."},{"schema":{"type":"string"},"in":"query","name":"maxAgeSeconds","required":false,"description":"Only include vehicles that finished within this many seconds."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"vehicles":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["datasetId","vehicles"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/fleet-watches/{watchId}":{"get":{"summary":"A fleet watch: when each watched vehicle ran, over the last days (Poznań's /bonczyk)","tags":["vehicles"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"days","required":false,"description":"Service days to report, today first (1–400, default 30)."},{"schema":{"type":"string"},"in":"path","name":"watchId","required":true,"description":"The watch's id, e.g. bonczyk (Poznań's trams from Bonn)."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"watchId":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"model":{"type":["null","string"]},"generatedAt":{"type":"string"},"timeZone":{"type":"string"},"today":{"type":"string"},"trackingSince":{"type":["null","string"]},"summary":{"type":"object","additionalProperties":true},"days":{"type":"array","items":{"type":"object","additionalProperties":true}},"vehicles":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["datasetId","watchId","generatedAt","today","summary","days","vehicles"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/trips/{tripId}/details":{"get":{"summary":"Get trip metadata, shape, stops, realtime vehicle, and next stops","tags":["trips"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"vehicleId","required":false,"description":"Optional realtime vehicle_id when more than one vehicle reports the trip."},{"schema":{"type":"boolean","default":true},"in":"query","name":"includeShape","required":false},{"schema":{"type":"boolean","default":true},"in":"query","name":"includePastStops","required":false},{"schema":{"type":"integer","minimum":1,"maximum":64,"default":8},"in":"query","name":"nextStopsLimit","required":false},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"in":"query","name":"serviceDate","required":false,"description":"Service date YYYY-MM-DD of the run; on any day but the current service day the trip comes without realtime data."},{"schema":{"type":"string"},"in":"path","name":"tripId","required":true,"description":"GTFS trip_id. URL-encode values containing ^, +, /, or spaces."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"tripId":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"trip":{"type":"object","additionalProperties":true},"route":{"type":"object","additionalProperties":true},"realtimeVehicle":{"type":"object","nullable":true,"properties":{"vehicleId":{"type":"string"},"entityId":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"routeId":{"type":"string","nullable":true},"tripStartDate":{"type":"string","nullable":true},"tripStartTime":{"type":"string","nullable":true},"currentStopSequence":{"type":"number","nullable":true},"currentStatus":{"type":"number","nullable":true},"lat":{"type":"number"},"lon":{"type":"number"},"bearing":{"type":"number","nullable":true},"speed":{"type":"number","nullable":true},"feedTimestamp":{"type":"number"},"vehicleTimestamp":{"type":"number","nullable":true},"receivedAt":{"type":"string"},"features":{"type":"object","nullable":true,"properties":{"wheelchairAccessible":{"type":"boolean"},"airConditioning":{"type":"boolean"},"bicyclesAllowed":{"type":"boolean"},"voiceAnnouncements":{"type":"boolean"},"usbCharger":{"type":"boolean"},"ticketMachine":{"type":"boolean"}}},"model":{"type":"object","nullable":true,"description":"What the vehicle is, from its city's fleet data (Trójmiasto, Poznań, Kraków MPK, Katowice); null when unknown. Not in /ws/network frames.","properties":{"brand":{"type":"string","nullable":true,"description":"Null where the model names the make."},"model":{"type":"string","description":"\"Urbino 18 IV Electric\", or with the make (\"Mercedes O530 C2 Hybrid\")."},"productionYear":{"type":"integer","nullable":true},"propulsion":{"type":"string","nullable":true,"description":"diesel, electric, hybrid, cng, lng or hydrogen."},"lowFloor":{"type":"integer","nullable":true,"description":"0 high floor, 1 partly low, 2 low."},"airConditioning":{"type":"boolean","nullable":true},"operator":{"type":"string","nullable":true},"patron":{"type":"string","nullable":true,"description":"Who the vehicle is named after (Gdańsk)."},"source":{"type":"object","description":"The credit to show with the data.","properties":{"name":{"type":"string"},"url":{"type":"string","nullable":true},"licence":{"type":"string","nullable":true},"dataDate":{"type":"string","nullable":true,"description":"The publisher's date of the data, YYYY-MM-DD."},"fetchedAt":{"type":"string","nullable":true,"description":"When it was downloaded; null for a file kept in the repo."}},"required":["name","url","licence","dataDate","fetchedAt"]}},"required":["brand","model","productionYear","propulsion","lowFloor","airConditioning","operator","patron","source"]}},"required":["vehicleId","entityId","label","routeId","tripStartDate","tripStartTime","currentStopSequence","currentStatus","lat","lon","bearing","speed","feedTimestamp","vehicleTimestamp","receivedAt"]},"shape":{"type":"object","nullable":true,"properties":{"shapeId":{"type":"string","nullable":true},"pointCount":{"type":"number"},"points":{"type":"array","items":{"type":"object","properties":{"sequence":{"type":"number"},"lat":{"type":"number"},"lon":{"type":"number"},"shapeDistTraveled":{"type":"number","nullable":true}},"required":["sequence","lat","lon","shapeDistTraveled"]}}},"required":["shapeId","pointCount","points"]},"stops":{"type":"array","items":{"type":"object","properties":{"stopSequence":{"type":"number"},"stopId":{"type":"string"},"stopCode":{"type":"string","nullable":true},"stopName":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"arrivalTimeSeconds":{"type":"number"},"departureTimeSeconds":{"type":"number"},"arrivalTime":{"type":"string"},"departureTime":{"type":"string"},"stopHeadsign":{"type":"string","nullable":true},"pickupType":{"type":"number","nullable":true},"dropOffType":{"type":"number","nullable":true},"shapeDistTraveled":{"type":"number","nullable":true},"realtime":{"type":"object","nullable":true,"properties":{"arrivalDelay":{"type":"number","nullable":true},"arrivalTime":{"type":"number","nullable":true},"departureDelay":{"type":"number","nullable":true},"departureTime":{"type":"number","nullable":true},"scheduleRelationship":{"type":"number","nullable":true},"feedTimestamp":{"type":"number","nullable":true},"tripUpdateTimestamp":{"type":"number","nullable":true},"receivedAt":{"type":"string","nullable":true}},"required":["arrivalDelay","arrivalTime","departureDelay","departureTime","scheduleRelationship","feedTimestamp","tripUpdateTimestamp","receivedAt"]},"isPassed":{"type":"boolean"},"isNext":{"type":"boolean"}},"required":["stopSequence","stopId","stopCode","stopName","lat","lon","arrivalTimeSeconds","departureTimeSeconds","arrivalTime","departureTime","stopHeadsign","pickupType","dropOffType","shapeDistTraveled","realtime","isPassed","isNext"]}},"nextStops":{"type":"array","items":{"type":"object","properties":{"stopSequence":{"type":"number"},"stopId":{"type":"string"},"stopCode":{"type":"string","nullable":true},"stopName":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"arrivalTimeSeconds":{"type":"number"},"departureTimeSeconds":{"type":"number"},"arrivalTime":{"type":"string"},"departureTime":{"type":"string"},"stopHeadsign":{"type":"string","nullable":true},"pickupType":{"type":"number","nullable":true},"dropOffType":{"type":"number","nullable":true},"shapeDistTraveled":{"type":"number","nullable":true},"realtime":{"type":"object","nullable":true,"properties":{"arrivalDelay":{"type":"number","nullable":true},"arrivalTime":{"type":"number","nullable":true},"departureDelay":{"type":"number","nullable":true},"departureTime":{"type":"number","nullable":true},"scheduleRelationship":{"type":"number","nullable":true},"feedTimestamp":{"type":"number","nullable":true},"tripUpdateTimestamp":{"type":"number","nullable":true},"receivedAt":{"type":"string","nullable":true}},"required":["arrivalDelay","arrivalTime","departureDelay","departureTime","scheduleRelationship","feedTimestamp","tripUpdateTimestamp","receivedAt"]},"isPassed":{"type":"boolean"},"isNext":{"type":"boolean"}},"required":["stopSequence","stopId","stopCode","stopName","lat","lon","arrivalTimeSeconds","departureTimeSeconds","arrivalTime","departureTime","stopHeadsign","pickupType","dropOffType","shapeDistTraveled","realtime","isPassed","isNext"]}},"vehicleDay":{"type":"object","nullable":true,"properties":{"vehicleId":{"type":"string"},"sinceEpoch":{"type":"number"},"trips":{"type":"array","items":{"type":"object","properties":{"tripId":{"type":"string"},"routeId":{"type":"string","nullable":true},"routeShortName":{"type":"string","nullable":true},"routeType":{"type":"number","nullable":true},"routeColor":{"type":"string","nullable":true},"routeTextColor":{"type":"string","nullable":true},"headsign":{"type":"string","nullable":true},"scheduledStart":{"type":"string","nullable":true},"firstSeenEpoch":{"type":"number"},"lastSeenEpoch":{"type":"number"},"isCurrent":{"type":"boolean"}},"required":["tripId","routeId","routeShortName","routeType","routeColor","routeTextColor","headsign","scheduledStart","firstSeenEpoch","lastSeenEpoch","isCurrent"]}}},"required":["vehicleId","sinceEpoch","trips"]}},"required":["datasetId","tripId","generatedAt","trip","route","realtimeVehicle","shape","stops","nextStops"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/trips/{tripId}/shape":{"get":{"summary":"Get ordered shape points for a trip","tags":["trips"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"tripId","required":true,"description":"GTFS trip_id. URL-encode values containing ^, +, /, or spaces."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"tripId":{"type":"string"},"shapeId":{"type":"string","nullable":true},"pointCount":{"type":"number"},"points":{"type":"array","items":{"type":"object","properties":{"sequence":{"type":"number"},"lat":{"type":"number"},"lon":{"type":"number"},"shapeDistTraveled":{"type":"number","nullable":true}},"required":["sequence","lat","lon","shapeDistTraveled"]}}},"required":["datasetId","tripId","shapeId","pointCount","points"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/trips/{tripId}/next-stops":{"get":{"summary":"Get next stops for a trip from latest realtime vehicle state","tags":["trips"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"vehicleId","required":false,"description":"Optional realtime vehicle_id when more than one vehicle reports the trip."},{"schema":{"type":"integer","minimum":1,"maximum":64,"default":8},"in":"query","name":"nextStopsLimit","required":false},{"schema":{"type":"string"},"in":"path","name":"tripId","required":true,"description":"GTFS trip_id. URL-encode values containing ^, +, /, or spaces."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"tripId":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"realtimeVehicle":{"type":"object","nullable":true,"properties":{"vehicleId":{"type":"string"},"entityId":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"routeId":{"type":"string","nullable":true},"tripStartDate":{"type":"string","nullable":true},"tripStartTime":{"type":"string","nullable":true},"currentStopSequence":{"type":"number","nullable":true},"currentStatus":{"type":"number","nullable":true},"lat":{"type":"number"},"lon":{"type":"number"},"bearing":{"type":"number","nullable":true},"speed":{"type":"number","nullable":true},"feedTimestamp":{"type":"number"},"vehicleTimestamp":{"type":"number","nullable":true},"receivedAt":{"type":"string"},"features":{"type":"object","nullable":true,"properties":{"wheelchairAccessible":{"type":"boolean"},"airConditioning":{"type":"boolean"},"bicyclesAllowed":{"type":"boolean"},"voiceAnnouncements":{"type":"boolean"},"usbCharger":{"type":"boolean"},"ticketMachine":{"type":"boolean"}}},"model":{"type":"object","nullable":true,"description":"What the vehicle is, from its city's fleet data (Trójmiasto, Poznań, Kraków MPK, Katowice); null when unknown. Not in /ws/network frames.","properties":{"brand":{"type":"string","nullable":true,"description":"Null where the model names the make."},"model":{"type":"string","description":"\"Urbino 18 IV Electric\", or with the make (\"Mercedes O530 C2 Hybrid\")."},"productionYear":{"type":"integer","nullable":true},"propulsion":{"type":"string","nullable":true,"description":"diesel, electric, hybrid, cng, lng or hydrogen."},"lowFloor":{"type":"integer","nullable":true,"description":"0 high floor, 1 partly low, 2 low."},"airConditioning":{"type":"boolean","nullable":true},"operator":{"type":"string","nullable":true},"patron":{"type":"string","nullable":true,"description":"Who the vehicle is named after (Gdańsk)."},"source":{"type":"object","description":"The credit to show with the data.","properties":{"name":{"type":"string"},"url":{"type":"string","nullable":true},"licence":{"type":"string","nullable":true},"dataDate":{"type":"string","nullable":true,"description":"The publisher's date of the data, YYYY-MM-DD."},"fetchedAt":{"type":"string","nullable":true,"description":"When it was downloaded; null for a file kept in the repo."}},"required":["name","url","licence","dataDate","fetchedAt"]}},"required":["brand","model","productionYear","propulsion","lowFloor","airConditioning","operator","patron","source"]}},"required":["vehicleId","entityId","label","routeId","tripStartDate","tripStartTime","currentStopSequence","currentStatus","lat","lon","bearing","speed","feedTimestamp","vehicleTimestamp","receivedAt"]},"currentStopSequence":{"type":"number","nullable":true},"stops":{"type":"array","items":{"type":"object","properties":{"stopSequence":{"type":"number"},"stopId":{"type":"string"},"stopCode":{"type":"string","nullable":true},"stopName":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"arrivalTimeSeconds":{"type":"number"},"departureTimeSeconds":{"type":"number"},"arrivalTime":{"type":"string"},"departureTime":{"type":"string"},"stopHeadsign":{"type":"string","nullable":true},"pickupType":{"type":"number","nullable":true},"dropOffType":{"type":"number","nullable":true},"shapeDistTraveled":{"type":"number","nullable":true},"realtime":{"type":"object","nullable":true,"properties":{"arrivalDelay":{"type":"number","nullable":true},"arrivalTime":{"type":"number","nullable":true},"departureDelay":{"type":"number","nullable":true},"departureTime":{"type":"number","nullable":true},"scheduleRelationship":{"type":"number","nullable":true},"feedTimestamp":{"type":"number","nullable":true},"tripUpdateTimestamp":{"type":"number","nullable":true},"receivedAt":{"type":"string","nullable":true}},"required":["arrivalDelay","arrivalTime","departureDelay","departureTime","scheduleRelationship","feedTimestamp","tripUpdateTimestamp","receivedAt"]},"isPassed":{"type":"boolean"},"isNext":{"type":"boolean"}},"required":["stopSequence","stopId","stopCode","stopName","lat","lon","arrivalTimeSeconds","departureTimeSeconds","arrivalTime","departureTime","stopHeadsign","pickupType","dropOffType","shapeDistTraveled","realtime","isPassed","isNext"]}}},"required":["datasetId","tripId","generatedAt","realtimeVehicle","currentStopSequence","stops"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/routes/{routeId}/shapes":{"get":{"summary":"Get the dominant shape geometry per direction for a route","tags":["routes"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"routeId","required":true,"description":"GTFS route_id. URL-encode values containing ^, +, /, or spaces."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"routeId":{"type":"string"},"shapes":{"type":"array","items":{"type":"object","properties":{"shapeId":{"type":"string","nullable":true},"directionId":{"type":"number","nullable":true},"pointCount":{"type":"number"},"points":{"type":"array","items":{"type":"object","properties":{"sequence":{"type":"number"},"lat":{"type":"number"},"lon":{"type":"number"},"shapeDistTraveled":{"type":"number","nullable":true}},"required":["sequence","lat","lon","shapeDistTraveled"]}}},"required":["shapeId","directionId","pointCount","points"]}}},"required":["datasetId","routeId","shapes"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/routes/{routeId}/stops":{"get":{"summary":"Get a line's stops in both directions and its live vehicles","tags":["routes"],"parameters":[{"schema":{"type":"string"},"in":"path","name":"routeId","required":true,"description":"GTFS route_id. URL-encode values containing ^, +, /, or spaces."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"routeId":{"type":"string"},"generatedAt":{"type":"string","format":"date-time"},"route":{"type":"object","properties":{"routeId":{"type":"string"},"shortName":{"type":"string","nullable":true},"longName":{"type":"string","nullable":true},"type":{"type":"number"},"color":{"type":"string","nullable":true},"textColor":{"type":"string","nullable":true}},"required":["routeId","shortName","longName","type","color","textColor"]},"directions":{"type":"array","items":{"type":"object","properties":{"directionId":{"type":"number","nullable":true},"headsign":{"type":"string","nullable":true},"shapeId":{"type":"string","nullable":true},"tripCount":{"type":"number"},"stops":{"type":"array","items":{"type":"object","properties":{"stopId":{"type":"string"},"stopCode":{"type":"string","nullable":true},"stopName":{"type":"string"},"lat":{"type":"number"},"lon":{"type":"number"},"stopSequence":{"type":"number"},"servesTram":{"type":"boolean"},"servesBus":{"type":"boolean"},"servesMetro":{"type":"boolean"},"servesRail":{"type":"boolean"}},"required":["stopId","stopCode","stopName","lat","lon","stopSequence","servesTram","servesBus","servesMetro","servesRail"]}}},"required":["directionId","headsign","shapeId","tripCount","stops"]}},"vehicles":{"type":"array","items":{"type":"object","properties":{"vehicle":{"type":"object","additionalProperties":true,"properties":{"delaySeconds":{"type":"integer","nullable":true,"description":"Current delay in seconds from GTFS-RT trip updates, positive = late, negative = early, null = unknown."},"trip_short_name":{"type":"string","nullable":true,"description":"A train's number, with its name when it has one (\"77521\", \"10110/1 Łukowiak\"); its replacement bus's too. Only on trains, whose vehicle_id is their trip id, not a fleet number."},"agency_name":{"type":"string","nullable":true,"description":"A train's carrier (\"Koleje Wielkopolskie\"). Only on trains."}}},"nextStopId":{"type":"string","nullable":true},"nextStopName":{"type":"string","nullable":true},"nextStopSequence":{"type":"number","nullable":true},"atFirstStop":{"type":"boolean"},"tripShortName":{"type":"string","nullable":true}},"required":["vehicle","nextStopId","nextStopName","nextStopSequence","atFirstStop"]}}},"required":["datasetId","routeId","generatedAt","route","directions","vehicles"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/geocode":{"get":{"summary":"Geocode an address or place to coordinates","tags":["planner"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"q","required":false,"description":"Free-text address or place query."},{"schema":{"type":"string"},"in":"query","name":"limit","required":false,"description":"Maximum number of results."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string"},"results":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["query","results"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/geocode/reverse":{"get":{"summary":"The address or nearest named place at a coordinate","tags":["planner"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"lat","required":true,"description":"Latitude of the point."},{"schema":{"type":"string"},"in":"query","name":"lon","required":true,"description":"Longitude of the point."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"lat":{"type":"number","description":"The point looked up: the query rounded to 4 decimals (~10 m)."},"lon":{"type":"number"},"name":{"type":"string","nullable":true,"description":"Street and house number, else the nearest named place; null when none was found."},"locality":{"type":"string","nullable":true,"description":"District and town."},"label":{"type":"string","nullable":true,"description":"The provider's full address line."}},"required":["lat","lon","name","locality","label"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/journeys":{"get":{"summary":"Plan public-transport journeys between two coordinates","tags":["planner"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"fromLat","required":true,"description":"Origin latitude."},{"schema":{"type":"string"},"in":"query","name":"fromLon","required":true,"description":"Origin longitude."},{"schema":{"type":"string"},"in":"query","name":"toLat","required":true,"description":"Destination latitude."},{"schema":{"type":"string"},"in":"query","name":"toLon","required":true,"description":"Destination longitude."},{"schema":{"type":"string"},"in":"query","name":"departAt","required":false,"description":"Departure time as Unix epoch seconds."},{"schema":{"type":"string"},"in":"query","name":"arriveBy","required":false,"description":"Latest arrival as Unix epoch seconds, instead of departAt."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"from":{"type":"object","additionalProperties":true},"to":{"type":"object","additionalProperties":true},"requestedDepartEpoch":{"type":"number"},"requestedArriveEpoch":{"type":["null","number"]},"journeys":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["datasetId","from","to","requestedDepartEpoch","journeys"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"500":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/ws/network":{"get":{"responses":{"200":{"description":"Default Response"}}}},"/api/regions":{"get":{"summary":"List the regions (cities) and datasets this server runs","tags":["regions"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"generatedAt":{"type":"string"},"defaultRegionId":{"type":"string","nullable":true},"regions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"primaryDatasetId":{"type":"string"},"datasetIds":{"type":"array","items":{"type":"string"}},"center":{"type":"object","properties":{"latitude":{"type":"number"},"longitude":{"type":"number"}},"required":["latitude","longitude"]},"zoom":{"type":"number"},"bounds":{"type":"object","properties":{"minLatitude":{"type":"number"},"minLongitude":{"type":"number"},"maxLatitude":{"type":"number"},"maxLongitude":{"type":"number"}},"required":["minLatitude","minLongitude","maxLatitude","maxLongitude"]}},"required":["id","name","primaryDatasetId","datasetIds","center","zoom","bounds"]}},"datasets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"attribution":{"type":"string","nullable":true},"realtime":{"type":"string","enum":["feed","schedule","none"]}},"required":["id","name","type","attribution","realtime"]}}},"required":["generatedAt","defaultRegionId","regions","datasets"]}}}}}}},"/open/v1/feeds":{"get":{"summary":"Catalog of every dataset's GTFS and GTFS-RT feeds","tags":["open-data"],"description":"Absolute URLs of each dataset's static GTFS export and GTFS-RT feeds, with the export's version and dates.","responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"generatedAt":{"type":"string","format":"date-time"},"feeds":{"type":"array","items":{"type":"object","properties":{"datasetId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"timezone":{"type":"string"},"bounds":{"type":"object","properties":{"minLatitude":{"type":"number"},"minLongitude":{"type":"number"},"maxLatitude":{"type":"number"},"maxLongitude":{"type":"number"}},"required":["minLatitude","minLongitude","maxLatitude","maxLongitude"],"nullable":true},"attribution":{"type":"string","nullable":true,"description":"A credit line to show with the data, when its sources ask for one."},"sources":{"type":"array","items":{"type":"string"},"description":"The upstream feeds this dataset is made from."},"credits":{"type":"array","description":"Whom to credit and under which licence or terms, per source (also in the ZIP's attributions.txt and README.txt).","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"data":{"type":"string"},"licence":{"type":"string"},"licenceUrl":{"type":"string","nullable":true}},"required":["name","url","data","licence","licenceUrl"]}},"static":{"type":"object","properties":{"url":{"type":"string"},"available":{"type":"boolean","description":"false until the first export after an import (minutes)."},"version":{"type":"string","nullable":true},"generatedAt":{"type":"string","nullable":true},"dataUpdatedAt":{"type":"string","nullable":true},"startDate":{"type":"string","nullable":true,"description":"YYYYMMDD"},"endDate":{"type":"string","nullable":true,"description":"YYYYMMDD"},"sizeBytes":{"type":"number","nullable":true}},"required":["url","available","version","startDate","endDate","sizeBytes"]},"realtime":{"type":"object","properties":{"vehiclePositions":{"type":"object","nullable":true,"properties":{"url":{"type":"string"},"source":{"type":"string","enum":["feed","schedule"],"description":"feed: the operator's GTFS-RT, its ids made those of the static export. schedule: vehicles placed by the timetable, exactly on time; no measured position."}},"required":["url","source"]},"tripUpdates":{"type":"object","nullable":true,"properties":{"url":{"type":"string"},"source":{"type":"string","enum":["feed","schedule"],"description":"feed: the operator's GTFS-RT, its ids made those of the static export. schedule: vehicles placed by the timetable, exactly on time; no measured position."}},"required":["url","source"]}},"required":["vehiclePositions","tripUpdates"]}},"required":["datasetId","name","type","timezone","bounds","attribution","sources","credits","static","realtime"]}}},"required":["generatedAt","feeds"]}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/open/v1/feeds/{datasetId}/gtfs.zip":{"get":{"summary":"A dataset's static GTFS as this server holds it","tags":["open-data"],"description":"Every operator part merged, the regional trains of the area included, ids as in the GTFS-RT feeds. Rebuilt after each import; send If-None-Match with the ETag (the feed_version) to download only a new one.","parameters":[{"schema":{"type":"string"},"in":"path","name":"datasetId","required":true,"description":"A dataset id from GET /open/v1/feeds."}],"responses":{"401":{"description":"Default Response","content":{"application/zip":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"404":{"description":"Default Response","content":{"application/zip":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"429":{"description":"Default Response","content":{"application/zip":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"503":{"description":"Default Response","content":{"application/zip":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}},"head":{"summary":"A dataset's static GTFS as this server holds it","tags":["open-data"],"description":"Every operator part merged, the regional trains of the area included, ids as in the GTFS-RT feeds. Rebuilt after each import; send If-None-Match with the ETag (the feed_version) to download only a new one.","parameters":[{"schema":{"type":"string"},"in":"path","name":"datasetId","required":true,"description":"A dataset id from GET /open/v1/feeds."}],"responses":{"401":{"description":"Default Response","content":{"application/zip":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"404":{"description":"Default Response","content":{"application/zip":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"429":{"description":"Default Response","content":{"application/zip":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"503":{"description":"Default Response","content":{"application/zip":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/open/v1/key-requests":{"post":{"summary":"Ask for an API key","tags":["open-data"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120,"pattern":"\\S"},"email":{"type":"string","format":"email","maxLength":254},"message":{"type":"string","maxLength":2000},"website":{"type":"string","maxLength":200}},"required":["name","email"],"additionalProperties":false}}},"required":true},"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}}}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/open/v1/feeds/{datasetId}/vehicle-positions.pb":{"get":{"summary":"A dataset's GTFS-RT VehiclePositions","tags":["open-data"],"description":"The operator's feed with the ids of the static export. A dataset without one has vehicles placed by the timetable instead: X-Position-Source says schedule, and GET /open/v1/feeds says so too.","parameters":[{"schema":{"type":"string"},"in":"path","name":"datasetId","required":true,"description":"A dataset id from GET /open/v1/feeds."}],"responses":{"401":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"404":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"429":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"503":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/open/v1/feeds/{datasetId}/trip-updates.pb":{"get":{"summary":"A dataset's GTFS-RT TripUpdates","tags":["open-data"],"description":"The operator's trip updates and the regional trains' (mkuran.pl), with the ids of the static export.","parameters":[{"schema":{"type":"string"},"in":"path","name":"datasetId","required":true,"description":"A dataset id from GET /open/v1/feeds."}],"responses":{"401":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"404":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"429":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"503":{"description":"Default Response","content":{"application/x-protobuf":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/open/v1/journeys":{"get":{"summary":"Plan public-transport journeys between two coordinates","tags":["open-data"],"description":"Planned on the dataset whose region holds both points (or the one given), by the timetable; the same answer as /api/journeys. 10 searches a day per address without an API key (X-API-Key), 1000 a day per key.","parameters":[{"schema":{"type":"string"},"in":"query","name":"fromLat","required":true,"description":"Origin latitude."},{"schema":{"type":"string"},"in":"query","name":"fromLon","required":true,"description":"Origin longitude."},{"schema":{"type":"string"},"in":"query","name":"toLat","required":true,"description":"Destination latitude."},{"schema":{"type":"string"},"in":"query","name":"toLon","required":true,"description":"Destination longitude."},{"schema":{"type":"string"},"in":"query","name":"departAt","required":false,"description":"Departure time as Unix epoch seconds."},{"schema":{"type":"string"},"in":"query","name":"arriveBy","required":false,"description":"Latest arrival as Unix epoch seconds, instead of departAt."},{"schema":{"type":"string"},"in":"query","name":"datasetId","required":false,"description":"The dataset to plan in; by default the one whose region holds both points."}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"datasetId":{"type":"string"},"from":{"type":"object","additionalProperties":true},"to":{"type":"object","additionalProperties":true},"requestedDepartEpoch":{"type":"number"},"requestedArriveEpoch":{"type":["null","number"]},"journeys":{"type":"array","items":{"type":"object","additionalProperties":true}}},"required":["datasetId","from","to","requestedDepartEpoch","journeys"]}}}},"400":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"401":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"404":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}},"429":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"statusCode":{"type":"number"},"error":{"type":"string"},"message":{"type":"string"}},"required":["statusCode","error","message"]}}}}}}},"/api/version":{"get":{"summary":"Show the release version (and commit) this server runs","tags":["health"],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"commit":{"type":"string","nullable":true}},"required":["version","commit"]}}}}}}}},"servers":[{"url":"http://127.0.0.1:3000","description":"ZTM Poznań local backend"}],"tags":[{"name":"health","description":"Runtime health checks and the release version"},{"name":"regions","description":"Cities and datasets; every dataset's API is also served under /datasets/<id>"},{"name":"static-gtfs","description":"Static GTFS feed status and sync"},{"name":"realtime-gtfs","description":"GTFS-RT feed status and polling"},{"name":"service","description":"Why the network may look empty: timetable, feed health, today's service"},{"name":"vehicles","description":"Current public transport vehicle state"},{"name":"stops","description":"Static GTFS stop locations"},{"name":"trips","description":"Trip shapes, stops, and realtime progression"},{"name":"open-data","description":"For other apps: each dataset's GTFS and GTFS-RT as this server holds them, and the journey planner"}]}