# BC Route Planner REST API API

> Finds shortest/fastest route between a start point and one or more stop points on British Columbia's public road network. The BC Route planner [webpage](https://www2.gov.bc.ca/gov/content?id=9D99E684CCD042CD88FADC51E079B4B5) provides additional information. Here are some geocoded addresses to play with:<br>18 Douglas St,Victoria -123.36962,48.40892<br>1002 Johnson St, Victoria -123.355745,48.426206<br>543 Johnson St, Victoria, BC -123.36907,48.42770 <br>14 Centennial Sq, Victoria, BC -123.36564,48.42863<br>1105 Royal Ave,New Westminster -122.92009,49.20063<br>808 Jackson Cres, New Westminster -122.90762,49.22558<br>10810 McDonald Rd, Chilliwack -121.93808,49.19859<br>3950 June Springs Rd, Kelowna -119.40751,49.83960<br>1201 Riondel Rd, Kootenay Bay -116.85402,49.74448<br>1201 Riondel Rd, Kootenay Bay -116.832759,49.730500 (parcelPoint)<br>2499 Walbran Pl, Courtenay -124.97295,49.71518<br>2013 Smoke Bluff Rd, Squamish -123.13946,49.70401<br>235 Kelvin Grove Way, Lions Bay -123.23524,49.45035<br> Please see our <a href=https://github.com/bcgov/api-specs/blob/master/COLLECTION_NOTICE.md#collection-notice target="_blank">data collection notice</a>. Please note that you may experience issues when submitting requests to the delivery or test environment if using this [OpenAPI specification](https://github.com/bcgov/api-specs) in other API console viewers. [API keys](https://api.gov.bc.ca/devportal/api-directory/740) are unique and can be acquired with a GitHub or IDIR account.

BC Route Planner REST API is an open data API from gov.bc.ca. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 24 endpoints.

## At a glance

- Category: [Open Data](https://www.openparable.com/apis/category/open-data)
- Provider: gov.bc.ca
- Authentication: API key
- HTTPS: Yes
- CORS: Not stated
- Base URL: https://router.api.gov.bc.ca/
- Documentation: https://github.com/bcgov/ols-router/blob/gh-pages/router-developer-guide.md
- OpenAPI description: https://api.apis.guru/v2/specs/gov.bc.ca/router/2.0.0/openapi.json
- Version: 2.0.0
- Specification updated: 2023-03-06

## Example request

```bash
curl -X GET "https://router.api.gov.bc.ca/directions.OUTPUTFORMAT" \
  -H "Accept: application/json" \
  -H "X-API-Key: YOUR_API_KEY"
```

## Endpoints

- `GET /directions.{outputFormat}` — Get the directions, path, distance and travel time between a series of geographic points
- `POST /directions.{outputFormat}` — Get the directions, path, distance and travel time between a series of geographic points
- `GET /distance.{outputFormat}` — Get distance and travel time between two geographic points
- `POST /distance.{outputFormat}` — Get distance and travel time between two geographic points
- `GET /distance/betweenPairs.{outputFormat}` — Get distance and travel time between each pair of geographic points
- `POST /distance/betweenPairs.{outputFormat}` — Get distance and travel time between each pair of geographic points
- `GET /optimalDirections.{outputFormat}` — Get the directions, optimal path, distance and travel time between a start point and a series of end points which are reordered to minimize total distance or ti
- `POST /optimalDirections.{outputFormat}` — Get the directions, optimal path, distance and travel time between a start point and one or more end points which are reordered to minimize total distance or ti
- `GET /optimalRoute.{outputFormat}` — Get the optimal path, distance and travel time between a start point and a series of end points which are reordered to minimize total distance or time.
- `POST /optimalRoute.{outputFormat}` — Get the path, distance and travel time between a start point and a series of end points which are reordered to minimize total distance or time.
- `GET /route.{outputFormat}` — Get the path, distance and travel time between a series of geographic points
- `POST /route.{outputFormat}` — Get the path, distance and travel time between a series of geographic points
- `GET /truck/directions.{outputFormat}` — Get the directions, path, distance and travel time between a series of geographic points for a commercial vehicle
- `POST /truck/directions.{outputFormat}` — Get the directions, path, distance and travel time between a series of geographic points
- `GET /truck/distance.{outputFormat}` — Get distance and travel time between two geographic points for a commercial vehicle
- `POST /truck/distance.{outputFormat}` — Get distance and travel time between two geographic points
- `GET /truck/distance/betweenPairs.{outputFormat}` — Get distance and travel time between each pair of geographic points for a commercial vehicle
- `POST /truck/distance/betweenPairs.{outputFormat}` — Get distance and travel time between each pair of geographic points
- `GET /truck/optimalDirections.{outputFormat}` — Get the directions, optimal path, distance and travel time between a start point and a series of end points which are reordered to minimize total distance or ti
- `POST /truck/optimalDirections.{outputFormat}` — Get the directions, optimal path, distance and travel time between a start point and one or more end points which are reordered to minimize total distance or ti
- `GET /truck/optimalRoute.{outputFormat}` — Get the optimal path, distance and travel time between a start point and a series of end points which are reordered to minimize total distance or time for a com
- `POST /truck/optimalRoute.{outputFormat}` — Get the path, distance and travel time between a start point and a series of end points which are reordered to minimize total distance or time.
- `GET /truck/route.{outputFormat}` — Get the path, distance and travel time between a series of geographic points for a commercial vehicle
- `POST /truck/route.{outputFormat}` — Get the path, distance and travel time between a series of geographic points

## Questions

### Does the BC Route Planner REST API API need an API key?

Yes. The BC Route Planner REST API API uses API key authentication; the documentation explains how to get credentials.

### Does the BC Route Planner REST API API support HTTPS?

Yes, the BC Route Planner REST API API is served over HTTPS.

### How many endpoints does the BC Route Planner REST API API have?

Its OpenAPI description lists 24 endpoints in version 2.0.0. All of them are shown on this page.

### What are alternatives to the BC Route Planner REST API API?

Other Open Data APIs include Search Services, Wayback API, Wikipedia, Nasdaq Data Link, University of Oslo.

## Similar open data APIs

- [Search Services](https://www.openparable.com/apis/search-services): API for Internet Archive's Search-related services
- [Wayback API](https://www.openparable.com/apis/wayback): API for Internet Archive's Wayback Machine
- [Wikipedia](https://www.openparable.com/apis/wikipedia): Mediawiki Encyclopedia
- [Nasdaq Data Link](https://www.openparable.com/apis/nasdaq-data-link): The source for financial, economic, and alternative datasets, serving investment professionals.
- [University of Oslo](https://www.openparable.com/apis/university-of-oslo): Courses, lecture videos, detailed information for courses etc. for the University of Oslo (Norway)
- [Data API](https://www.openparable.com/apis/data): Serves the Clever Data API
- [Kaggle](https://www.openparable.com/apis/kaggle): Create and interact with Datasets, Notebooks, and connect with Kaggle
- [CollegeScoreCard.ed.gov](https://www.openparable.com/apis/collegescorecard-ed-gov): Data on higher education institutions in the United States
- [U.S. EPA Enforcement and Compliance History Online (ECHO) - All Data](https://www.openparable.com/apis/u-s-epa-enforcement-and-compliance-history-online-echo-all-data): Enforcement and Compliance History Online (ECHO) is a tool developed and maintained by EPA's Office of Enforcement and Compliance Assurance for public use. ECHO provides integrated compliance and enforcement information for over 1 million regulated facilities nationwide. ECHO Rest Services provide multiple service endpoints, each with specific capabilities, to search and retrieve data on facilities regulated as Clean Air Act (CAA) stationary sources, Clean Water Act (CWA) dischargers, Resource Conservation and Recovery Act (RCRA) hazardous waste generators/handlers, and Safe Drinking Water Act (SDWA) public water systems. Data of interest from other EPA sources, such as the Toxics Release Inventory, is also supplied for context. \ The get_facilities, get_map, get_qid, and get_download end points are meant to be used together, while the enhanced get_facility_info end point is self contained. The get_facility_info end point returns either an array of state, county or zip clusters with summary statistics per cluster or an array of facilities. \ The recommended use scenario for get_facilities, get_qid, get_map, and get_downoad is: \ <b>1)</b> Use get_facilities to validate passed query parameters, obtain summary statistics and to obtain a query_id (QID). QIDs are time sensitive and will be valid for approximately 30 minutes. <b>2)</b> Use get_qid, with the returned QID, to paginate through arrays of facility results. <b>3)</b> Use get_map, with the returned QID, to zoom in/out and pan on the clustered and individual facility coordinates that meet the QID query criteria. <b>4)</b> Use get_download, with the returned QID, to generate a Comma Separated Value (CSV) file of facility information that meets the QID query criteria. \ \ Use the qcolumns parameter to customize your search results. Use the Metadata service endpoint for a list of available output objects, their Column Ids, and their definitions to help you build your customized output. \ Additional ECHO Resources: <a href="https://echo.epa.gov/tools/web-services">Web Services</a>, <a href="https://echo.epa.gov/resources/echo-data/about-the-data">About ECHO's Data</a>, <a href="https://echo.epa.gov/tools/data-downloads">Data Downloads</a>
- [Authorized Partner API Specification](https://www.openparable.com/apis/authorized-partner-specification): To access files in user’s DigiLocker account from your application, you must first obtain user’s authorization.
- [GENESIS](https://www.openparable.com/apis/genesis): Federal Statistical Office Germany
- [Scoop.it](https://www.openparable.com/apis/scoop-it): Content Curation Service

Listed from: APIs.guru (CC0). Check the provider's terms before use.

---

Source: https://www.openparable.com/apis/bc-route-planner (OpenParable). Cite the canonical URL above.
