The API endpoints follow the same pattern as many of the website URLs.
For example, stop times found on this page:
http://nextbus.jt2k.com/route/17/dir/1/stop/GRAKIRNN
can be requested by prepending the path with api
and adding your API key:
http://nextbus.jt2k.com/api/route/17/dir/1/stop/GRAKIRNN?key=:api_key
All of the methods listed below should be sent as GET requests.
/api/routes
Returns array of routes.
/api/route/:route_id
Retrieve a route.
Returns array of directions (integer-indexed array specifying name of direction for the 0 and 1 directions).
/api/route/:route_id/dir/:direction_id
Retrieve a direction for a route. :direction_id should be 0 or 1.
Returns array of stops.
/api/route/:route_id/dir/:direction_id/stop/:stop_id
Retrieve a stop for a specific route and direction.
Returns array of times.
/api/stop/:stop_id
Retrieve a stop for all routes.
Returns array of times.
/api/findstop/:latitude,:longitude
Retrieve list of stops closest to specified coordinates
Returns array of stops including routes and directions.