Code Monkey home page Code Monkey logo

bc-ferries-api's Introduction

๐Ÿ›ณ BC Ferries API - bcferriesapi.ca

The only public API for retrieving current data on BC Ferries sailings. Used in my app BC Ferry Times, an iOS app to get the latest ferry schedule and sailing capacities.

How It's Made

BC Ferries API is a Go api connected to a web scraper. The scraper is made with Goquerey. It runs every minute and saves the relevant, formatted data to a json file. When the api recieves a request, it checks the validity of the request, then returns the specified data.

API Reference

This API uses the route codes used by BC Ferries, they are:

"TSA" -> Tsawwassen
"SWB" -> Swartz Bay
"SGI" -> Southern Gulf Islands
"DUK" -> Duke Point (Nanaimo)
"FUL" -> Fulford Harbour (Salt Spring Island)
"HSB" -> Horseshoe Bay
"NAN" -> Departure Bay (Nanaimo)
"LNG" -> Langford
"BOW" -> Bowen Island

The api runs on the format:

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

You can be as specific as needed, the fewer arguments there are, the more data you will recieve.

For example, https://www.bcferriesapi.ca/api/tsawwassen will return all data for all sailings leaving from Tsawwassen.

A request to https://www.bcferriesapi.ca/api/ will return a full schedule for all terminals.

Options for each are as follows:

departure-terminal

"TSA"
"SWB"
"HSB"
"DUK"
"LNG"
"NAN"
"FUL"
"BOW"

destination-terminal

Note: destination terminal must correspond with departure terminal, for example you can't put tsawwassen to langdale, it will return an error.

"TSA": [
    "SWB"
    "SGI"
    "DUK"
]
"SWB": [
    "TSA"
    "FUL"
    "SGI"
]
"HSB": [
    "NAN"
    "LNG"
    "BOW"
]
"DUK": [
    "TSA"
]
"LNG": [
    "HSB"
]
"NAN": [
    "HSB"
]
"FUL": [
    "SWB"
]
"BOW": [
    "HSB"
]

Sample response

A sample response from https://www.bcferriesapi.ca/api/ can be found in sample_response.json.

Used By

Add your project here if it uses the BC Ferries API.

  • BC Ferry Times: An iOS app to get the latest ferry schedule and sailing capacities.
  • MMM BC Ferries: A MagicMirror2 module that displays the current info for scheduled sailings of a specified BC Ferries route.
  • Cascadia Crossing: An iOS app to get the latest border crossing times, ferry schedules, and sailing capacitites.

bc-ferries-api's People

Contributors

samuel-pratt avatar dependabot[bot] avatar enejb avatar daytonturner avatar kianapaz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.