samuel-pratt / bc-ferries-api

🛳 The only public API for retrieving current data on BC Ferries sailings.
https://bcferriesapi.ca
MIT License
34 stars 11 forks source link
api bc-ferries go golang goquery

BC Ferries API - bcferriesapi.ca

The BC Ferries API provides current data on BC Ferries sailings and schedules for all routes.

Running Locally

To run locally you must have a postgres database set up with the tables in db_setup.sql included. Create a .env file from the .ev.sample and fill it with the database info.

Once that's set up just build the project with:

go build

And run it with:

./bc-ferries-api

And you're good to go!

API Reference

V2

Version 2 of the API includes data for all terminals and routes served by BC Ferries. The response is structured as an array of "route" objects, each defining departure and arrival terminals, along with a JSON object containing sailings for that specific route.

Endpoints:

The root /v2/ route provides data for both capacity and non-capacity sailings. Non-capacity includes information on all BC Ferries routes, while capacity data covers routes with vessel fill data reported by BC Ferries.

Capacity Route Codes:

V1

This API uses the following route codes used by BC Ferries:

The API endpoint format is:

https://www.bcferriesapi.ca/api/<departure-terminal>/<destination-terminal>

You can specify departure and destination terminals to get relevant data.

Available Departure Terminals:

Available Destination Terminals:

Please note that the destination terminal must correspond to the departure terminal, incorrect pairings will return an error.

Used By

Projects using the BC Ferries API: