The base URL is
https://api.radar.io. Send your API key in the Authorization header. All five operations accept a publishable key, so you can call them from a client. Route match and Optimize route are available on the Enterprise plan. For key types, the error format, and rate limits, see Authentication, errors, and rate limits.
Units, modes, and geometry
These conventions apply to every routing operation.Coordinates
Coordinates in requests are strings in the formatlatitude,longitude. Lists of coordinates are pipe-delimited: latitude0,longitude0|latitude1,longitude1. URL-encode the pipe as %7C if your HTTP client doesn’t do it for you.
Distance and duration values
Distances and durations are returned as objects with a numericvalue and a display text.
duration.value is always in minutes, as a decimal number. units defaults to imperial, so send units=metric if your application works in meters.
Travel modes
Geometry formats
Thegeometry parameter controls the shape of the route in the response.
Encoded polylines contain backslash characters. Decode the JSON response before you decode the polyline, so that escaped backslashes are handled correctly.
Straight-line distance and route distance
Distance returns both.routes.geodesic is the straight-line distance between the two points and has no duration. The entries keyed by travel mode are route distances and ETAs along the road network. Label them differently in your interface, for example “2.1 mi away” and “8 min drive”.
Distance
Calculates the travel distance and duration between an origin and a destination.- Endpoint:
GET /v1/route/distance - Authentication: Publishable key
- Rate limit: 50 requests per second
- Used by: Build store locators, Track pickups, deliveries, and workers
Query parameters
Response
A200 response contains meta and these fields:
Example
This request calculates the walking and driving distance between two points.Errors
A
400 response looks like this:
Matrix
Calculates the travel distances and durations between multiple origins and destinations, for up to 625 routes in one request. The number of routes is the number of origins multiplied by the number of destinations.- Endpoint:
GET /v1/route/matrix - Authentication: Publishable key
- Rate limit: 10 requests per second
- Used by: Build store locators, Track pickups, deliveries, and workers
Query parameters
Response
A200 response contains meta and these fields:
Example
This request calculates driving distances from one origin to two destinations.Errors
Route match
Snaps points collected along a route to the roads that were most likely traveled. Returns the matched path and, optionally, road attributes such as names and speed limits.- Endpoint:
POST /v1/route/match - Authentication: Publishable key
- Rate limit: 10 requests per second
- Used by: Track pickups, deliveries, and workers
Route matching is available on the Enterprise plan.
Body parameters
Send a JSON body withContent-Type: application/json.
The same operation is also available as
GET https://api.radar.io/v1/route/match, with mode, roadAttributes, units, and geometry as query parameters and path as a pipe-delimited string of coordinates. The GET form can’t carry createdAt or accuracy, so prefer POST when you have them.
Response
A200 response contains meta and these fields:
roadClass is one of the following, in descending order of road size:
Example
This request snaps two points to the road network and returns road attributes.Errors
A
400 response looks like this:
Directions
Calculates the most efficient route between two or more locations visited in the order you provide, with turn-by-turn steps.- Endpoint:
GET /v1/route/directions - Authentication: Publishable key
- Rate limit: 20 requests per second
- Used by: Display maps, Track pickups, deliveries, and workers
Query parameters
Response
A200 response contains meta and routes. routes is an array. It has one route unless you sent alternatives=true and Radar found alternative routes.
Each step has these fields. Step field names use snake case.
Example
This request gets driving directions between two locations, with the route shape as apolyline6 string.
Errors
A
400 response looks like this:
Optimize route
Calculates the optimal ordering and route to visit a list of locations. The first location is the origin of the route and the last location is the final destination. Radar chooses the order of the locations in between.- Endpoint:
GET /v1/route/optimize - Authentication: Publishable key
- Rate limit: 10 requests per second
- Used by: Track pickups, deliveries, and workers
Route optimization is available on the Enterprise plan.
Query parameters
Response
A200 response contains meta and route:
To read the optimized stop order, take
startIndex of the first leg followed by endIndex of every leg. In the example below, the order is 0, 3, 2, 1, 4.
Example
This request orders three stops between a fixed origin and a fixed final destination.Errors
Limits
Rate limits apply per project. A request over the limit returns
429. For retry guidance and how to request a higher limit, see Rate limits.