Data
Distance between coordinates API
Great-circle (haversine) distance and initial bearing between two latitude/longitude points. Answers 'distance between these coordinates', 'how far apart are these two points', 'bearing from A to B'.
Price$0.01per request
MethodPOST
Route/v1/data/geo-distance
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
datageodistancehaversinecoordinatesbearing
API URL
Integration docshttps://x402.hexl.dev/v1/data/geo-distanceExample request
{
"lat1": 40.7128,
"lon1": -74.006,
"lat2": 51.5074,
"lon2": -0.1278
}Example response
{
"km": 5570.222,
"miles": 3461.2,
"bearingDegrees": 51.2
}Input schema
{
"type": "object",
"required": [
"lat1",
"lon1",
"lat2",
"lon2"
],
"properties": {
"lat1": {
"type": "number"
},
"lon1": {
"type": "number"
},
"lat2": {
"type": "number"
},
"lon2": {
"type": "number"
}
}
}Output schema
{
"type": "object",
"required": [
"km",
"miles",
"bearingDegrees"
],
"properties": {
"km": {
"type": "number"
},
"miles": {
"type": "number"
},
"bearingDegrees": {
"type": "number"
}
}
}