Setup
Put them in your environment or
.env; Data APIs covers the other ways.
Notes
- Billed in credits against a daily limit. Each response’s X-RateLimit-Credits header gives the cost of that call and X-RateLimit-Remaining the credits left before it; 429 means the daily or per-minute limit is spent.
- Points are ‘latitude,longitude’ in requests, and multi-value parameters repeat (point=..&point=..); pass a list.
- The free package supports only the car, bike and foot profiles.
Endpoints
Calculate a route
- Distances are metres, times milliseconds.
- Coordinates in the response are [longitude, latitude] (GeoJSON order), the reverse of the point parameter.
Geocode an address or place
- The default provider does prefix matching, tuned for autocomplete.
Reverse geocode a point
- Do not send q with reverse=true.
Compute a distance/time matrix
- Large matrices use the async POST /matrix/calculate flow instead (not in this entry).