{"uid":"cap_DsgYbFXRZ6QwtnCgFxnMr","slug":"api-x402node-dev-dfbf4c49","name":"Haversine Great-Circle Distance Calculator","description":"Haversine great-circle distance between two coordinates. Returns km, miles, bearing degrees. Use ?lat1=X and lng1=Y and lat2=A and lng2=B. Built for AI agents for proximity checks and routing pre-filters.","url":"https://api.x402node.dev/maps/distance","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","properties":{"lat1":{"type":"string","description":"Lat1 (optional)"},"lat2":{"type":"string","description":"Lat2 (optional)"},"lng1":{"type":"string","description":"Lng1 (optional)"},"lng2":{"type":"string","description":"Lng2 (optional)"}}}},"additionalProperties":false}}},"responseSchema":null,"example":{"request":{"lat1":40.7128,"lat2":51.5074,"lng1":-74.006,"lng2":-0.1278},"response":{"to":{"lat":51.5074,"lng":-0.1278},"from":{"lat":40.7128,"lng":-74.006},"_hint":"x402 paid endpoints for AI agents — x402node.dev (utilities) · cn402.com (Chinese culture)","bearing_deg":51.21,"distance_km":5570.222,"distance_miles":3461.175}},"exampleRequest":{"lat1":40.7128,"lat2":51.5074,"lng1":-74.006,"lng2":-0.1278},"tags":["x402"],"displayCostAmount":"0.0022","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"settled","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.0022/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0022","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0022","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_AV8wL79vSOHRQcl9S7JEw","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0022","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the haversine great-circle distance and bearing between two geographic coordinates, returning results in km, miles, and bearing degrees.","exampleAgentPrompt":"What's the straight-line distance and bearing between coordinates 40.7128, -74.0060 and 51.5074, -0.1278?","exampleUseCases":[{"title":"Field service dispatch optimization","prompt":"Before sending our repair technician to the next job, tell me how far they'll need to travel from their current location and what direction to head."},{"title":"Location-based alert filtering","prompt":"We're getting alerts from sensors all over the city. Filter down to only the ones within 5 kilometers of our warehouse, and tell me which direction each one is from us."},{"title":"Real-time ride matching proximity","prompt":"A rider just requested a pickup at coordinates 40.7505, -73.9972. Show me the straight-line distance to our three nearest available drivers so we can send the closest one."}],"resultDescription":"Returns an object containing the great-circle distance in kilometers, distance in miles, and the bearing in degrees between the two input coordinate pairs.","failureModes":["Missing or invalid lat/lng parameters — endpoint may return an error or unexpected result","Coordinates out of valid range (lat outside -90 to 90, lng outside -180 to 180) causing computation errors","Payment failure due to insufficient USDC balance (x402 payment required at $0.0022 per call)","Malformed request body causing a 400-level error"],"whenToPreferThis":"Use this endpoint when you need a fast, lightweight great-circle distance calculation between two known coordinate pairs — especially for proximity checks, routing pre-filters, or deciding whether two points are within a threshold distance. Prefer this over full routing APIs when you only need straight-line distance and bearing without turn-by-turn directions or road network data.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T13:02:20.277Z","isFirstParty":false}