Open data
Every train we've recorded, at every station, free to download. It's the raw record the site is built from. How late each train was at each stop, when it actually left and whether it stopped at all, exactly as Auckland Transport's live feed reported it. Nothing is filled in or tidied up.
What's here
Everything is at data.aklontrack.com/open/v1/. No sign up or key needed.
- Daily files: one JSON file per day at
observations/YYYY/MM/DD.json. A new one goes up each night. - Trip files: one JSON file per day at
trips/YYYY/MM/DD.json, listing every timetabled train and whether it ran in full, ran part of the way, or never ran. Our reliability figure is counted from these. - Monthly files: when a month ends, its days are bundled into one zipped CSV at
observations/YYYY-MM.csv.gz. Times in these are UTC. - Reference files: stations, lines and directions, how much of each day we recorded, and planned closures.
- Catalogue: index.json lists every file, and the changelog lists any fixes.
Reading a day file
The column names are listed once at the top, under fields. Each row after that holds the values in the same order. Stops sit inside their trip, and each stop points to its station by its position in the stops list. Times are seconds from t0, which is midnight in Auckland at the start of that day.
state: 0 means we saw the train stop, 1 means it was cancelled, 2 means it skipped that stop, and 3 means AT sent nothing for it.arrival_delayanddeparture_delay: seconds late. A negative number means early.direction_id: 0 or 1. It means something different on each line, so checkroutes.json.trip_id: AT's name for that run, without the short code AT adds to the end. It's empty in the rare case we couldn't match the trip.trip_relandstop_rel: AT's own status codes, kept exactly as they came.
Reading a trip file
Laid out the same way, one row per timetabled train. Unlike the day files, this is our judgement, not AT's feed: we compare what the feed showed against the timetable.
outcome: 0 ran in full, 1 ran part of the way (it stopped short of the end of its line, or started partway along), 2 never ran, 3 we couldn't tell (usually because we were down at the time), 4 reached the end but went through a stop without stopping.planned: 1 when it fell inside a planned closure (inclosures.json).start: the time it was timetabled to leave, in seconds after midnight. It can pass 86,400 for a train leaving after midnight.- Reliability is the trains with outcome 0, out of every train except outcomes of 3 and planned ones. Outcomes 1 and 4 count as part runs, 2 as cancelled.
Good to know
- Use departures. AT stops sending a train's arrival once it reaches a station, so the arrival we kept is AT's last guess. The last stop of a trip is the exception.
- Trains that were timetabled but never turned up aren't in the day files, because the feed never mentioned them. They are in the trip files, as outcome 2.
- Trains running after midnight count towards the day they started. The day ticks over at 3am.
- If we were down for a while, some stops will be missing.
coverage.jsonand the Uptime page show how much we got. - A trip can show up twice in one day if AT put out a new timetable while it was running.
Licence
CC BY 4.0, commercial use included. Please credit "AklOnTrack, from Auckland Transport data". The source data belongs to Auckland Transport and is used under the same licence. We're not connected to them.
Built something with it? We'd love to hear about it.