{"uid":"cap_KM_axK5A56i8tOhwKk79W","slug":"fastx402-haversine-distance-calculator-3b5669ad","name":"FastX402 Haversine Distance Calculator","description":"200 pay-per-call tools for AI agents, from $0.001 per request in USDC on Base or Solana with x402. No account, no API key.","url":"https://fastx402.tools/haversine-distance?utm_source=zero.xyz","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","required":["lat1","lon1","lat2","lon2"],"properties":{"lat1":{"type":"string","description":"Latitude of point A"},"lat2":{"type":"string","description":"Latitude of point B"},"lon1":{"type":"string","description":"Longitude of point A"},"lon2":{"type":"string","description":"Longitude of point B"},"unit":{"enum":["km","mi","nm"],"type":"string","description":"km (default), mi or nm"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"unit":{"type":"string"},"distance":{"type":"number"},"initial_bearing":{"type":"number"}}}}}}},"responseSchema":{"type":"json","example":{"unit":"km","distance":349.356,"initial_bearing":108.73}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_lgAv7xuujL9ZtfzL_dR7b","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Calculates the great-circle distance and initial bearing between two geographic coordinates using the Haversine formula","exampleAgentPrompt":"What is the straight-line distance in kilometers between New York City (40.7128, -74.0060) and London (51.5074, -0.1278), and what's the initial bearing?","exampleUseCases":[{"title":"Delivery radius eligibility check","prompt":"Is a customer at 37.7749° N, 122.4194° W within 50 km of our warehouse at 37.3382° N, 121.8863° W? Give me the distance in kilometers."},{"title":"Flight distance between cities","prompt":"How many nautical miles is it from Los Angeles (34.0522, -118.2437) to Tokyo (35.6762, 139.6503)? Use nautical miles as the unit."},{"title":"Hiking trail segment length","prompt":"What's the distance in miles between the trailhead at latitude 36.4864, longitude -118.5658 and the summit at latitude 36.5785, longitude -118.2923?"}],"resultDescription":"Returns a JSON object with the computed distance as a decimal number, the unit used (km, mi, or nm), and the initial bearing in degrees from point A toward point B.","failureModes":["Missing required query parameters (lat1, lon1, lat2, lon2) returns an error","Invalid coordinate values (out of range lat/lon) may produce incorrect results or an error","Invalid unit enum value returns an error","Payment failure via x402 prevents the request from being processed"],"whenToPreferThis":"Choose this endpoint when you need a fast, accurate great-circle distance computation between two lat/lon pairs without setting up an account or API key. It is ideal for lightweight geospatial calculations in agent workflows where you want pay-per-use pricing ($0.001 USDC) and no subscription overhead. Prefer this over full mapping APIs when you only need distance and bearing, not routing, geocoding, or map rendering.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-27T19:20:29.297Z","isFirstParty":false,"canonicalSlug":"fastx402-haversine-distance-calculator-3b5669ad"}