Skip to content

A web API for interfacing with Canadian border waiting times.

License

Notifications You must be signed in to change notification settings

kshvmdn/border-times

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

border-times

A web API for interfacing with Canadian border waiting times. All data is scraped from the official Government of Canada website. Wait times are updated at least once an hour (per GC).

Setup

  • Clone repo, install requirements.

    $ git clone https://github.com/kshvmdn/border-times.git && cd border-times
    $ pip install -r ./requirements.txt
  • Run app, should be listening at localhost:8000.

    $ python ./bordertimes.py

Usage

Output Format
{
  "meta": {
    "status": Number,
    "message": String
  },
  "data": {
    "port_info": {
      "name": String,
      "from": String,
      "to": String
    },
    "wait_times": {
      "commercial": String,
      "non_commercial": String
    },
    "last_updated": String
  }
}
Endpoints
Endpoint Description
/api Retrieve the datasets for all ports.
/api/list List all available ports.
/api/<port> Retrieve the dataset for a single port.
Examples
/api/Rainbow%20Bridge
{
  "meta": {
    "status": 200,
    "message": "OK"
  },
  "data": {
    "port_info": {
      "name": "Rainbow Bridge",
      "from": "Niagara Falls, ON",
      "to": "Niagara Falls, NY"
    },
    "wait_times": {
      "commercial": "Not applicable",
      "non_commercial": "no delay 7 lane(s) open"
    },
    "last_updated": "2016-06-13 17:52"
  }
}
/api/list
{
  "meta": {
    "status": 200,
    "message": "OK"
  },
  "data": [
    "Abbotsford-Huntingdon",
    "Aldergrove",
    "Ambassador Bridge",
    "Blue Water Bridge",
    "Boundary Bay",
    "Cornwall",
    "Coutts",
    "Douglas (Peace Arch)",
    "Edmundston",
    "Emerson",
    "Fort Frances Bridge",
    "North Portal",
    "Pacific Highway",
    "Peace Bridge",
    "Prescott",
    "Queenston-Lewiston Bridge",
    "Rainbow Bridge",
    "Sault Ste. Marie",
    "St-Armand/Philipsburg",
    "St-Bernard-de-Lacolle",
    "St. Stephen",
    "St. Stephen 3rd Bridge",
    "Stanstead",
    "Thousand Islands Bridge",
    "Windsor and Detroit Tunnel",
    "Woodstock Road"
  ]
}

About

A web API for interfacing with Canadian border waiting times.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published