An unofficial API for retrieving live Brampton Transit bus times.
Live at http://transit.kshvmdn.com (might take a few seconds to spin up, it's running on Heroku's free tier).
Data source: Brampton Transit Next Ride (desktop, mobile).
-
-
Retrieve a list of routes. Optionally filter by route code or name.
-
Optional query parameters:
code
- Route codename
- Route name (case insensitive)
-
Examples:
-
{ "data": [ { "route": "1", "route_name": "Queen, West" }, { "route": "1", "route_name": "Queen, East" }, ... ], "status": { "code": 200, "message": "OK" } }
-
{ "data": [ { "route": "2", "route_name": "Main, South" }, { "route": "2", "route_name": "Main, North" } ], "status": { "code": 200, "message": "OK" } }
-
{ "data": [ { "route": "15", "route_name": "Bramalea, South" }, { "route": "15", "route_name": "Bramalea, North" }, { "route": "92", "route_name": "Bramalea GO Shuttle, South" }, { "route": "92", "route_name": "Bramalea GO Shuttle, North" } ], "status": { "code": 200, "message": "OK" } }
-
-
-
-
Retrieve a list of all stops separated by route.
-
Examples:
-
{ "data": [ { "route_id": "1004", "route": "1", "route_name": "Queen, West", "stops": [ { "stop": "4035", "stop_name": "Highway 50 - Zum Queen Station Stop" }, { "stop": "2543", "stop_name": "The Gore Rd n/of Queen St E" }, ... ] }, { "route_id": "1001", "route": "1", "route_name": "Queen, East", "stops": [ { "stop": "2315", "stop_name": "Mount Pleasant GO Station - Route 1" }, { "stop": "2807", "stop_name": "Bovaird - Zum Queen West Station St" }, ... ] }, ... ], "status": { "code": 200, "message": "OK" } }
-
-
-
-
Retrieve a list of stops filtered by route. If you wish to retrieve all stops, use
/stops
instead. -
Query parameters:
code
- Route codename
- Route name (case insensitive)
-
Examples:
-
{ "error": { "code": 400, "message": "Expected at least one parameter." } }
-
{ "data": [ { "route_id": "14003", "route": "14", "route_name": "Torbram, South", "stops": [ { "stop": "3498", "stop_name": "Torbram Rd s/of Father Tobin Rd" }, { "stop": "3499", "stop_name": "Torbram Rd at Australia Dr" }, ... ] }, { "route_id": "14002", "route": "14", "route_name": "Torbram, North", "stops": [ { "stop": "6157", "stop_name": "Westwood Mall Terminal Route 14 Sto" }, { "stop": "6004", "stop_name": "Goreway Rd s/of Morning Star Dr" }, ... ] } ], "status": { "code": 200, "message": "OK" } }
-
-
-
-
Retrieve a list of stops filtered by stop. If you wish to retrieve all stops, use
/stops
instead. -
Query parameters:
code
- Stop codename
- Stop name (case insensitive)
-
Examples:
-
{ "error": { "code": 400, "message": "Expected at least one parameter." } }
-
{ "data": [ { "route_id": "1004", "route": "1", "route_name": "Queen, West", "stops": [ { "stop": "4035", "stop_name": "Highway 50 - Zum Queen Station Stop" } ] }, { "route_id": "1001", "route": "1", "route_name": "Queen, East", "stops": [ { "stop": "4035", "stop_name": "Highway 50 - Zum Queen Station Stop" } ] }, ... ], "status": { "code": 200, "message": "OK" } }
-
-
-
-
Retrieve a list of stops matching the provided
query
. -
Examples:
-
{ "data": [ { "stop": "1113", "stop_name": "Bramalea - Zum Steeles Station Stop" }, { "stop": "1114", "stop_name": "Steeles Ave E at Bramalea GO Statio" }, { "stop": "1150", "stop_name": "Kensington Rd opp Bramalea Medical" }, ... ], "status": { "code": 200, "message": "OK" } }
-
-
-
-
Retrieve a list of upcoming busses at the given
stop
. -
Examples:
-
{ "data": { "stop": "1113", "stop_name": "Bramalea - Zum Steeles Station Stop", "routes": [ { "route": "511", "direction": "Zum Steeles WB", "eta": "07:26 PM" }, { "route": "11", "direction": "Steeles WB-11A", "eta": "07:33 PM" }, ... ] }, "status": { "code": 200, "message": "OK" } }
-
{ "data": { "stop": "2000", "stop_name": "Trinity Common Terminal Route 33/23", "routes": [ { "route": "23", "direction": "Sandalwood EB", "eta": "Due" }, { "route": "23", "direction": "Sandalwood EB", "eta": "07:42 PM" }, ... ] }, "status": { "code": 200, "message": "OK" } }
-
-
-
$ git clone https://github.com/kshvmdn/brampton-transit-api.git brampton-transit-api && cd $_
-
Install npm dependencies.
$ npm install
-
Start Redis. Use
--daemonize yes
to run server in background.$ redis-server
-
Start the application server.
$ PORT=<port> HOST=<host> REDIS_URL=<redis_url> NODE_ENV=<node_env> npm start # use start:dev to watch for changes
Running with Docker Compose
-
Requirements:
-
$ cd docker
-
Build containers.
$ docker-compose build
-
Start containers. Add
-d
to run in detached mode (i.e. in the background).$ docker-compose up
This project is completely open source, feel free to open an issue or submit a PR. Refer to the self-hosting guide to get started.
Before submitting a PR, please ensure your changes comply with the Standard style guide for JavaScript code.
$ npm run test:lint
MIT © Kashav Madan.