1---2name: bc-route-planner-rest-api3description: BC Route Planner REST API skill. Use when working with BC Route Planner REST for distance.{outputFormat}, distance, route.{outputFormat}. Covers 22 endpoints.4---5
6# BC Route Planner REST API
7API version: 2.0.0
8
9## Auth
10ApiKey apikey in header
11
12## Base URL
13https://router.api.gov.bc.ca/
14
15## Setup
161. Set your API key in the appropriate header
172. GET /distance.{outputFormat} -- verify access
183. POST /distance.{outputFormat} -- create first distance.{outputFormat}
19
20## Endpoints
21
2222 endpoints across 7 groups. See references/api-spec.lap for full details.
23
24### distance.{outputFormat}
25| Method | Path | Description |
26|--------|------|-------------|
27| GET | /distance.{outputFormat} | Get distance and travel time between two geographic points |
28| POST | /distance.{outputFormat} | Get distance and travel time between two geographic points |
29
30### distance
31| Method | Path | Description |
32|--------|------|-------------|
33| GET | /distance/betweenPairs.{outputFormat} | Get distance and travel time between each pair of geographic points |
34| POST | /distance/betweenPairs.{outputFormat} | Get distance and travel time between each pair of geographic points |
35
36### route.{outputFormat}
37| Method | Path | Description |
38|--------|------|-------------|
39| GET | /route.{outputFormat} | Get the path, distance and travel time between a series of geographic points |
40| POST | /route.{outputFormat} | Get the path, distance and travel time between a series of geographic points |
41
42### directions.{outputFormat}
43| Method | Path | Description |
44|--------|------|-------------|
45| GET | /directions.{outputFormat} | Get the directions, path, distance and travel time between a series of geographic points |
46| POST | /directions.{outputFormat} | Get the directions, path, distance and travel time between a series of geographic points |
47
48### optimalRoute.{outputFormat}
49| Method | Path | Description |
50|--------|------|-------------|
51| 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. |
52| 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. |
53
54### optimalDirections.{outputFormat}
55| Method | Path | Description |
56|--------|------|-------------|
57| 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 time. |
58| 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 time. |
59
60### truck
61| Method | Path | Description |
62|--------|------|-------------|
63| GET | /truck/distance.{outputFormat} | Get distance and travel time between two geographic points for a commercial vehicle |
64| POST | /truck/distance.{outputFormat} | Get distance and travel time between two geographic points |
65| GET | /truck/route.{outputFormat} | Get the path, distance and travel time between a series of geographic points for a commercial vehicle |
66| POST | /truck/route.{outputFormat} | Get the path, distance and travel time between a series of geographic points |
67| GET | /truck/directions.{outputFormat} | Get the directions, path, distance and travel time between a series of geographic points for a commercial vehicle |
68| POST | /truck/directions.{outputFormat} | Get the directions, path, distance and travel time between a series of geographic points |
69| 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 commercial vehicle |
70| 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. |
71| 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 time for a commercial vehicle |
72| 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 time. |
73
74## Common Questions
75
76Match user requests to endpoints in references/api-spec.lap. Key patterns:
77- "Get distance.{outputFormat} details?" -> GET /distance.{outputFormat}
78- "Get betweenPairs.{outputFormat} details?" -> GET /distance/betweenPairs.{outputFormat}
79- "Get route.{outputFormat} details?" -> GET /route.{outputFormat}
80- "Get directions.{outputFormat} details?" -> GET /directions.{outputFormat}
81- "Get optimalRoute.{outputFormat} details?" -> GET /optimalRoute.{outputFormat}
82- "Get optimalDirections.{outputFormat} details?" -> GET /optimalDirections.{outputFormat}
83- "Get distance.{outputFormat} details?" -> GET /truck/distance.{outputFormat}
84- "Get route.{outputFormat} details?" -> GET /truck/route.{outputFormat}
85- "Get directions.{outputFormat} details?" -> GET /truck/directions.{outputFormat}
86- "Get optimalRoute.{outputFormat} details?" -> GET /truck/optimalRoute.{outputFormat}
87- "Get optimalDirections.{outputFormat} details?" -> GET /truck/optimalDirections.{outputFormat}
88- "How to authenticate?" -> See Auth section
89
90## Response Tips
91- Check response schemas in references/api-spec.lap for field details
92- Create/update endpoints typically return the created/updated object
93
94## References
95- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas
96
97> Generated from the official API spec by [LAP](https://lap.sh)