Tiles
Tiles Endpoints
GET /sources
List Tile Sources
Returns all available vector tile sources.
Request URL: https://YOUR-RAPIDAPI-HOST/sources
Example Request
curl "https://YOUR-RAPIDAPI-HOST/sources" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Accept: application/json"
Example Response
{
"sources": [{
"id": "africa",
"name": "africa",
"format": "pbf",
"minzoom": 0,
"maxzoom": 14,
"bounds": "-20,-35,55,38",
"center": "18.4,-33.9,6",
"tiles": "https://YOUR-RAPIDAPI-HOST/tiles/africa/{z}/{x}/{y}",
"tilejson": "https://YOUR-RAPIDAPI-HOST/tiles/africa"
}]
}
GET /tiles/{source}
Get TileJSON
Returns TileJSON metadata for one source.
Request URL: https://YOUR-RAPIDAPI-HOST/tiles/{source}
Parameters
source
string
Required
Tile source ID returned by /sources.
Example Request
curl "https://YOUR-RAPIDAPI-HOST/tiles/{source}" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Accept: application/json"
Example Response
{
"tilejson": "3.0.0",
"name": "africa",
"attribution": "OpenStreetMap contributors",
"scheme": "xyz",
"format": "pbf",
"tiles": ["https://YOUR-RAPIDAPI-HOST/tiles/africa/{z}/{x}/{y}"],
"minzoom": 0,
"maxzoom": 14,
"bounds": [-20, -35, 55, 38],
"center": [18.4, -33.9, 6],
"vector_layers": []
}
GET /tiles/{source}/{z}/{x}/{y}
Get Vector Tile
Returns a Mapbox Vector Tile as binary protobuf bytes.
Request URL: https://YOUR-RAPIDAPI-HOST/tiles/{source}/{z}/{x}/{y}
Parameters
source
string
Required
Tile source ID returned by /sources.
z
integer
Required
Zoom level, 0 to 22.
x
integer
Required
XYZ tile column, 0 to (2^z) - 1.
y
integer
Required
XYZ tile row, 0 to (2^z) - 1.
Example Request
curl "https://YOUR-RAPIDAPI-HOST/tiles/{source}/{z}/{x}/{y}" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Accept: application/json"
Example Response
HTTP/1.1 200 OK
Content-Type: application/x-protobuf
Cache-Control: public, max-age=86400
<binary tile data>
A valid coordinate with no tile returns 204.
If tile bytes are gzip-compressed, the response includes Content-Encoding: gzip.
POST /tiles/{source}/cache/clear
Clear Tile Cache
Clears in-memory tile bytes for a source.
Request URL: https://YOUR-RAPIDAPI-HOST/tiles/{source}/cache/clear
Parameters
source
string
Required
Source ID whose cached tile bytes should be cleared.
Example Request
curl -X POST "https://YOUR-RAPIDAPI-HOST/tiles/{source}/cache/clear" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json"
Example Response
{
"cleared": 125,
"source": "africa"
}
Search
Search Endpoints
GET /search
Live Place / POI Search
Autocomplete search across indexed places and POIs.
Request URL: https://YOUR-RAPIDAPI-HOST/search?q=cape&types=place,poi&lat=-33.9249&lon=18.4241&size=10
Parameters
q
string
Required
Search query text. Minimum length: 2.
types
string
Optional
Comma-separated values, commonly place,poi.
lat
number
Optional
Latitude used to bias results by proximity.
lon
number
Optional
Longitude used to bias results by proximity.
size
integer
Optional
Maximum results, 1 to 25. Default: 10.
Example Request
curl "https://YOUR-RAPIDAPI-HOST/search?q=cape&types=place,poi&lat=-33.9249&lon=18.4241&size=10" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Accept: application/json"
Example Response
{
"query": "cape",
"total": 123,
"took_ms": 8,
"results": [{
"id": "osm:place:123",
"score": 42.21,
"index": "africa",
"doc_type": "place",
"display_name": "Cape Town, Western Cape, South Africa",
"name": "Cape Town",
"location": {"lat": -33.9249, "lon": 18.4241},
"canonical_id": "osm:place:123",
"source": "osm"
}]
}
GET /search/reverse
Reverse Geocode
Finds the nearest indexed places or POIs to a coordinate.
Request URL: https://YOUR-RAPIDAPI-HOST/search/reverse?lat=-33.9249&lon=18.4241&size=5&types=place,poi&radius=2km
Parameters
lat
number
Required
Latitude.
lon
number
Required
Longitude.
size
integer
Optional
Maximum results, 1 to 10. Default: 5.
types
string
Optional
Comma-separated values, commonly place,poi.
radius
string
Optional
Search radius, for example 1km, 500m, or 2km. Default: 2km.
Example Request
curl "https://YOUR-RAPIDAPI-HOST/search/reverse?lat=-33.9249&lon=18.4241&size=5&types=place,poi&radius=2km" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Accept: application/json"
Example Response
{
"lat": -33.9249,
"lon": 18.4241,
"took_ms": 6,
"results": [{
"id": "osm:place:123",
"doc_type": "place",
"display_name": "Cape Town, Western Cape, South Africa",
"location": {"lat": -33.9249, "lon": 18.4241},
"distance_m": 12.4
}]
}
GET /search/detail/{doc_id}
Get Search Detail
Fetches one indexed place or POI by document ID.
Request URL: https://YOUR-RAPIDAPI-HOST/search/detail/{doc_id}
Parameters
doc_id
string
Required
Document ID or canonical ID returned by search.
Example Request
curl "https://YOUR-RAPIDAPI-HOST/search/detail/{doc_id}" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Accept: application/json"
Routing
Routing Endpoints
POST /route
Turn-by-Turn Route
Calculates turn-by-turn directions between two or more locations.
Request URL: https://YOUR-RAPIDAPI-HOST/route
JSON Body Fields
locations
Routing Location[]
Required
Ordered route stops. Minimum 2.
costing
string
Optional
Transport mode. Default: auto.
costing_options
object
Optional
Options for the selected costing mode.
directions_options
object
Optional
Controls instruction output.
avoid_locations
object[]
Optional
Points to avoid. Radius 0 to 200.
avoid_polygons
array
Optional
Polygon areas to avoid.
alternates
integer
Optional
Number of alternate routes, 1 to 3.
date_time
object
Optional
Routing-engine date/time object.
shape_format
string
Optional
polyline6, polyline5, or geojson. Default: polyline6.
linear_references
boolean
Optional
Include linear references when supported.
elevation_interval
number
Optional
Include elevation samples along the route.
Example Request
curl -X POST "https://YOUR-RAPIDAPI-HOST/route" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json" \
+ -d '{
"locations": [
{"lon": 18.4241, "lat": -33.9249},
{"lon": 18.8602, "lat": -33.9321}
],
"costing": "auto",
"directions_options": {
"units": "kilometers",
"language": "en-US",
"directions_type": "instructions"
},
"alternates": 2,
"shape_format": "polyline6"
}'
Example JSON Body
{
"locations": [
{"lon": 18.4241, "lat": -33.9249},
{"lon": 18.8602, "lat": -33.9321}
],
"costing": "auto",
"directions_options": {
"units": "kilometers",
"language": "en-US",
"directions_type": "instructions"
},
"alternates": 2,
"shape_format": "polyline6"
}
POST /matrix
Matrix
Calculates a many-to-many travel time and distance matrix between sources and targets.
Request URL: https://YOUR-RAPIDAPI-HOST/matrix
JSON Body Fields
sources
Routing Location[]
Required
Origin locations. Minimum 1.
targets
Routing Location[]
Required
Destination locations. Minimum 1.
costing
string
Optional
auto, bicycle, pedestrian, truck, or motorcycle. Default: auto.
costing_options
object
Optional
Options for the selected costing mode.
units
string
Optional
kilometers or miles. Default: kilometers.
Example Request
curl -X POST "https://YOUR-RAPIDAPI-HOST/matrix" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json" \
+ -d '{
"sources": [{"lon": 18.4241, "lat": -33.9249}],
"targets": [
{"lon": 18.8602, "lat": -33.9321},
{"lon": 18.4770, "lat": -33.9870}
],
"costing": "auto",
"units": "kilometers"
}'
Example JSON Body
{
"sources": [{"lon": 18.4241, "lat": -33.9249}],
"targets": [
{"lon": 18.8602, "lat": -33.9321},
{"lon": 18.4770, "lat": -33.9870}
],
"costing": "auto",
"units": "kilometers"
}
POST /optimised_route
Optimised Route
Finds the best order to visit multiple stops.
Request URL: https://YOUR-RAPIDAPI-HOST/optimised_route
JSON Body Fields
locations
Routing Location[]
Required
Stops to optimize. Minimum 2.
costing
string
Optional
auto, bicycle, pedestrian, or truck. Default: auto.
costing_options
object
Optional
Options for the selected costing mode.
directions_options
object
Optional
Controls instruction output.
Example Request
curl -X POST "https://YOUR-RAPIDAPI-HOST/optimised_route" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json" \
+ -d '{
"locations": [
{"lon": 18.4241, "lat": -33.9249},
{"lon": 18.8602, "lat": -33.9321},
{"lon": 18.4770, "lat": -33.9870}
],
"costing": "auto"
}'
Example JSON Body
{
"locations": [
{"lon": 18.4241, "lat": -33.9249},
{"lon": 18.8602, "lat": -33.9321},
{"lon": 18.4770, "lat": -33.9870}
],
"costing": "auto"
}
POST /isochrone
Isochrone
Returns reachability contours from one location by time or distance.
Request URL: https://YOUR-RAPIDAPI-HOST/isochrone
JSON Body Fields
locations
Routing Location[]
Required
Exactly 1 origin location.
costing
string
Optional
auto, bicycle, pedestrian, truck, motorcycle, or motor_scooter. Default: auto.
costing_options
object
Optional
Options for the selected costing mode.
contours
object[]
Required
Each item uses time or distance.
polygons
boolean
Optional
Return polygons instead of lines. Default: true.
denoise
number
Optional
0 to 1.
generalize
number
Optional
>= 0.
show_locations
boolean
Optional
Include input locations. Default: true.
Example Request
curl -X POST "https://YOUR-RAPIDAPI-HOST/isochrone" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json" \
+ -d '{
"locations": [{"lon": 18.4241, "lat": -33.9249}],
"costing": "auto",
"contours": [{"time": 15}, {"time": 30}],
"polygons": true,
"show_locations": true
}'
Example JSON Body
{
"locations": [{"lon": 18.4241, "lat": -33.9249}],
"costing": "auto",
"contours": [{"time": 15}, {"time": 30}],
"polygons": true,
"show_locations": true
}
POST /map_match
Map Match
Snaps a GPS trace to the road network and returns a matched route.
Request URL: https://YOUR-RAPIDAPI-HOST/map_match
JSON Body Fields
shape
object[]
Conditional
Raw GPS trace points. Provide shape or encoded_polyline.
encoded_polyline
string
Conditional
Encoded trace polyline. Provide shape or encoded_polyline.
shape_match
string
Optional
map_snap, edge_walk, or walk_or_snap. Default: map_snap.
costing
string
Optional
auto, bicycle, pedestrian, bus, or motorcycle. Default: auto.
costing_options
object
Optional
Options for the selected costing mode.
directions_options
object
Optional
Controls instruction output.
trace_options
object
Optional
Advanced trace matching options.
units
string
Optional
kilometers or miles. Default: kilometers.
Example Request
curl -X POST "https://YOUR-RAPIDAPI-HOST/map_match" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json" \
+ -d '{
"shape": [
{"lon": 18.4241, "lat": -33.9249, "time": 0},
{"lon": 18.4300, "lat": -33.9300, "time": 30},
{"lon": 18.4400, "lat": -33.9350, "time": 60}
],
"shape_match": "map_snap",
"costing": "auto",
"units": "kilometers"
}'
Example JSON Body
{
"shape": [
{"lon": 18.4241, "lat": -33.9249, "time": 0},
{"lon": 18.4300, "lat": -33.9300, "time": 30},
{"lon": 18.4400, "lat": -33.9350, "time": 60}
],
"shape_match": "map_snap",
"costing": "auto",
"units": "kilometers"
}
POST /map_match/attributes
Map Match Attributes
Snaps a GPS trace to the road network and returns edge attributes.
Request URL: https://YOUR-RAPIDAPI-HOST/map_match/attributes
JSON Body Fields
request body
object
Required
Same request body as /map_match.
Example Request
curl -X POST "https://YOUR-RAPIDAPI-HOST/map_match/attributes" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Content-Type: application/json" \
+ -H "Accept: application/json" \
+ -d '{
"encoded_polyline": "ENCODED_POLYLINE_STRING",
"shape_match": "walk_or_snap",
"costing": "auto",
"trace_options": {}
}'
Example JSON Body
{
"encoded_polyline": "ENCODED_POLYLINE_STRING",
"shape_match": "walk_or_snap",
"costing": "auto",
"trace_options": {}
}
GET /costings
List Costings
Returns transport modes exposed by the API.
Request URL: https://YOUR-RAPIDAPI-HOST/costings
Example Request
curl "https://YOUR-RAPIDAPI-HOST/costings" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Accept: application/json"
GET /costing/options/{costing}
Get Costing Options Schema
Returns the JSON schema for costing options for a supported mode.
Request URL: https://YOUR-RAPIDAPI-HOST/costing/options/{costing}
Parameters
costing
string
Required
auto, bicycle, pedestrian, truck, motorcycle, or motor_scooter.
Example Request
curl "https://YOUR-RAPIDAPI-HOST/costing/options/{costing}" \
+ -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
+ -H "X-RapidAPI-Host: YOUR_RAPIDAPI_HOST" \
+ -H "Accept: application/json"
Example Response
{
"costing": "auto",
"options": {
"properties": {
"use_highways": {"type": "number", "minimum": 0, "maximum": 1},
"use_tolls": {"type": "number", "minimum": 0, "maximum": 1}
}
},
"usage": "Pass as costing_options.auto in your request body"
}