Open joshmcarthur opened 3 years ago
Please don't use the APIs on backend.metlink.org.nz, they are getting authorisation added to them very soon, so anything built against these will cease to function.
Use the Open Data APIs which provides full GTFS and GTFS-RT feeds. Stop Departures is getting added to the Open Data APIs in the next week or two. You can self sign-up at opendata.metlink.org.nz
Cool! I'm very out of date.
I've added a pointer to that on the top of the top level readme.
The new Metlink website is also using a new API hostname - https://backend.metlink.org.nz. This API is similar to, but different from the old API serving the old Metlink site.
So far, the only endpoint I have found and consumed is for stop departures, e.g. https://backend.metlink.org.nz/api/v1/stopdepartures/4404
This returns similar data to the old API:
Also, timetamp lookups:
curl 'https://backend.metlink.org.nz/api/v1/timetable' --data-raw '{"service":"402","start":"2021-02-12","end":"2021-02-12"}' --compressed
Route map:
curl 'https://backend.metlink.org.nz/api/v1/routemap' --data-raw '{"service":"402"}' --compressed
(Returns lots of GeoJSON)
Journey Plan:
There are some other API endpoints that use an API key:
These APIs are all using (I assume), the Metlink Open Data APIs (https://opendata.metlink.org.nz/getting-started). These APIs require an API key that is available after registration, but is rate limited.