The base URL is
https://api.radar.io. Maps resources live under /maps, not /v1. Map styles are MapLibre style JSON, vector tiles are Mapbox Vector Tile (MVT) with TileJSON metadata, satellite tiles are JPEG, and static maps are PNG.
Authentication
Maps resources require a publishable key. Pass it in one of two ways:- As the
publishableKeyquery parameter. Use this for URLs that a browser or map renderer fetches directly, such as an image source or a style URL, where you can’t set headers. - In the
Authorizationheader, as with the rest of the API.
401:
Referer doesn’t match an allowed origin returns 401 with the message Origin not allowed. See Set up organizations, projects, accounts, and authentication for key types and where to manage them.
Map styles
Returns a map style as a JSON document that conforms to the MapLibre Style Specification. The style references Radar’s tile, font, and sprite URLs with your publishable key already applied, so a MapLibre-compatible renderer needs only this one URL.- Endpoint:
GET /maps/styles/{style} - Authentication: Publishable key
- Used by: Display maps, Build store locators
Path parameters
Radar provides these styles:
A custom style ID is shown in the share dialog when you view or edit the style in the dashboard.
Query parameters
Response
A200 response is the style document, with Content-Type: application/json. It isn’t wrapped in a meta object. The response is sent with Cache-Control: no-cache, so fetch it each time you create a map instead of storing a copy.
Example
Pass the style URL to a MapLibre-compatible renderer. This example uses MapLibre GL JS. The page must load the MapLibre stylesheet and give the map container a height, or the map renders with zero height.Vector tiles
Radar map data is served as vector tiles in the Mapbox Vector Tile (MVT) format, described by a TileJSON document. Any renderer that supports these two standards can display Radar tiles.- Endpoint:
GET /maps/data/v1.jsonorGET /maps/tiles/v1/{z}/{x}/{y}.pbf - Authentication: Publishable key
- Zoom range: Tiles are available for zoom levels 0 to 14. Renderers overzoom the level 14 tiles to display higher zoom levels.
- Tile coordinates:
z,x, andyare integers in the standard XYZ tile scheme. - Used by: Display maps
This request gets the tile metadata:
Satellite tiles
Returns one raster tile of satellite imagery. Theradar-satellite-v1 and radar-hybrid-v1 styles reference this resource.
- Endpoint:
GET /maps/satellite/v1/{z}/{x}/{y} - Authentication: Publishable key
- Format: JPEG, 512 by 512 pixels
- Zoom range: 0 to 18
- Used by: Display maps
Satellite tiles are available on the Enterprise plan and must be enabled for your project. Contact your Radar account team.
403:
Static maps
Returns a standalone PNG image of a map. Use a static map anywhere an image works and an interactive map isn’t needed, such as an email, a receipt, or a list thumbnail. No JavaScript or mapping library is required.- Endpoint:
GET /maps/static - Authentication: Publishable key
- Format: PNG
- Used by: Display maps, Build store locators
Query parameters
If you send
markers, path, or bbox and omit center and zoom, Radar positions the map to fit all of them. If you also send center or zoom, your value overrides the fitted one.
Markers
Amarkers value is a pipe-delimited list of optional style options followed by one or more locations:
latitude,longitude. Each style option is optionName:optionValue. Style options must come before the locations and apply to every location in that markers value.
To draw markers with different styles in one image, repeat the parameter:
markers=markerStyle1|markerLocation1&markers=markerStyle2|markerLocation2.
Paths
Apath value is a pipe-delimited list of optional style options followed by the line’s locations:
latitude,longitude. Locations must come after the style options. In place of a list of locations, you can send an encoded polyline prefixed with enc: for 5 decimal places of precision or enc6: for 6 decimal places of precision:
polyline5 or polyline6 strings, which you can pass with enc: or enc6: to draw a route. URL-encode the polyline before you add it to the request URL.
Response
A200 response is the image, with Content-Type: image/png. Errors are returned as JSON, so an HTML image element shows a broken image when a parameter is invalid. Request the URL directly to read the error message.
Example
This URL requests a map centered on a point, with one marker, at double pixel density:scale=2, the returned image has twice as many pixels in each dimension and stays sharp on high-density displays.
This URL requests two marker styles and a line. Radar fits the map to them because center and zoom are omitted:
Errors
A
400 response looks like this:
Attribution
Radar map data comes from OpenStreetMap. Keep the Radar and OpenStreetMap attribution visible wherever you display a Radar map.
If you build a renderer integration that doesn’t read attribution from the style or TileJSON document, add the attribution to your map yourself.