Calculate airline and car routing distances between multiple points.
Query Parameters
Name
Type
Description
car
Boolean
get car routing distances
flight
Boolean
get flight distances
equal
Boolean
get equal distances
Headers
Name
Type
Description
X-RapidAPI-Key*
String
your Rapid API key
X-RapidAPI-Host*
String
distanceto.p.rapidapi.com
Request Body
Name
Type
Description
route*
JSON
{"route": {"vincenty":256.364,// airline distance in KM"haversine":255.6544674163047,// airline distance in KM"greatCircle":255.65447544186136,// airline distance in KM"car": {"distance":284.128,// car routing distance in KM"duration":11362.1,// car routing duration in Sec "status":"found"// flag indicating route was found } }"steps": [ ... ],"points": [ ... ]}
{"statusCode":404,"error":"Not Found","message":"Could not geocode all requested steps."}
{"statusCode":400,"error":"Bad Request","message":"Validation: Description of failed input validation"}
Request Body
{"route": [{"name":"Berlin",// Required: Any input text or lat,lng"country":"DEU"// Optional: ISO 3166-1 alpha-3 country code }, {"name":"Hamburg",// Required: Any input text or lat,lng"country":"DEU"// Optional: ISO 3166-1 alpha-3 country code }]}
Learn more about the request body payload and about input data here.
Calculate car routing distances between cities, addresses or postal codes with detailed country breakdown.
Headers
Name
Type
Description
X-RapidAPI-Key*
String
your Rapid API key
X-RapidAPI-Host*
String
distanceto.p.rapidapi.com
Request Body
Name
Type
Description
route*
JSON
{"steps": [ ... ],"points": [ ... ],"route": {"vincenty":839.042,// airline distance in KM"haversine":837.8439064749667,// airline distance in KM"greatCircle":837.8439327767333,// airline distance in KM"car": {"distance":983.968,// car routing distance in KM"duration":47253.3,// car routing distance in Sec."midpoint": {"distance":491.984,// distance in KM"coordinates": [12.829923011995646,56.12948896450904] },"countries": [{"country":"NO","distance":115.5178432,// driving distance in KM"duration":5547.537420000001// driving duration in Sec. }, {"country":"DK","distance":208.0108352,// driving distance in KM"duration":9989.34762// driving duration in Sec. }, {"country":"DE","distance":252.09260159999997,// driving distance in KM "duration":12106.29546// driving duration in Sec. }, {"country":"SE","distance":396.04712,// driving distance in KM"duration":19019.453250000002// driving duration in Sec. }] } }
{"statusCode":404,"error":"Not Found","message":"Could not geocode all requested steps."}
{"statusCode":400,"error":"Bad Request","message":"Validation: Description of failed input validation"}
Request body
{"route": [{"name":"Berlin",// Required: Any input text or lat,lng"country":"DEU"// Optional: ISO 3166-1 alpha-3 country code }, {"name":"Oslo",// Required: Any input text or lat,lng"country":"NOR"// Optional: ISO 3166-1 alpha-3 country code }]}
Learn more about the request body payload and about input data here.
Get maritime route distances. Points will be matched to the nearest sea route vertex.
Headers
Name
Type
Description
X-RapidAPI-Key*
String
your Rapid API key
X-RapidAPI-Host*
String
distanceto.p.rapidapi.com
Request Body
Name
Type
Description
route*
JSON
route object containing waypoint information. See description below.
{"steps": [ ... ],"points": [ ... ],"route": {"vincenty":839.042,// airline distance in KM"haversine":837.8439064749667,// airline distance in KM "greatCircle":837.8439327767333,// airline distance in KM"sea": {"distance":960.2291039330195,// maritime distance in KM"distanceNM":518.4824262723614,// maritime distance in NM"duration":25.92412131361807,// travel time in hours"status":"found"// flag indicating a maritime was found } }}
{"statusCode":400,"error":"Bad Request","message":"Validation: Description of failed input validation"}
{"statusCode":404,"error":"Not Found","message":"Could not geocode all requested steps."}
Request body
{"route": [{"name":"Hamburg",// Required: Any input text or lat,lng"country":"DEU"// Optional: ISO 3166-1 alpha-3 country code }, {"name":"Oslo",// Required: Any input text or lat,lng"country":"NOR"// Optional: ISO 3166-1 alpha-3 country code }]}
Learn more about the request body payload and about input data here.