{"uid":"cap_pTiHIDF1SS_LBwk_C_86L","slug":"us-geography-great-circle-distance-between-two-coordinates-51b3abcf","name":"US Geography: Great-Circle Distance Between Two Coordinates","description":"Great-circle (haversine) distance between two coordinates in km, miles and nautical miles, with bearing and midpoint.","url":"https://geo-us.x402tookit.com/coord-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":"number","description":"Latitude of point 1"},"lat2":{"type":"number","description":"Latitude of point 2"},"lon1":{"type":"number","description":"Longitude of point 1"},"lon2":{"type":"number","description":"Longitude of point 2"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"asOf":{"type":["null","string"]},"miles":{"type":["null","number"]},"meters":{"type":["null","number"]},"source":{"type":["null","string"]},"compass":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"midpoint":{"type":["null","object"],"properties":{"lat":{"type":["null","number"]},"lon":{"type":["null","number"]}}},"disclaimer":{"type":["null","string"]},"kilometers":{"type":["null","number"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"nauticalMiles":{"type":["null","number"]},"initialBearingDegrees":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","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.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_eNEp-VaNMvNOdJfMQ7X2s","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","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 between two lat/lon coordinates in km, miles, and nautical miles, plus initial bearing and geographic midpoint.","exampleAgentPrompt":"What's the straight-line distance between coordinates 40.7128°N, 74.0060°W (New York City) and 34.0522°N, 118.2437°W (Los Angeles) — give me kilometers, miles, nautical miles, the compass bearing, and the midpoint?","exampleUseCases":[{"title":"Flight path distance estimation","prompt":"Can you calculate the great-circle distance between JFK Airport at 40.6413° N, 73.7781° W and Heathrow at 51.4700° N, 0.4543° W? I need it in miles and nautical miles plus the initial bearing."},{"title":"Delivery radius check for logistics","prompt":"I need to know how far it is in kilometers and miles between our warehouse at 41.8827° N, 87.6233° W and a customer at 42.3601° N, 71.0589° W, plus which compass direction they are from us."},{"title":"Geographic midpoint for meeting location","prompt":"What's the midpoint between 47.6062° N, 122.3321° W (Seattle) and 37.7749° N, 122.4194° W (San Francisco), and how many miles apart are those two cities as the crow flies?"}],"resultDescription":"Returns the haversine great-circle distance in kilometers, miles, meters, and nautical miles; the initial bearing in degrees along with a compass direction string (e.g. 'NE'); and the geographic midpoint as a lat/lon object. Also includes a summary string, source attribution, and optional disclaimer or degraded-service flags.","failureModes":["Missing required query parameters (lat1, lon1, lat2, lon2) returns an error","Out-of-range latitude (>90 or <-90) or longitude (>180 or <-180) may cause computation error","Identical coordinates return zero distance and undefined bearing","Payment failure via x402 protocol returns 402 status before computation","Network timeout on the remote service returns no result"],"whenToPreferThis":"Choose this endpoint when you need a fast, accurate geodetic distance between two arbitrary lat/lon coordinate pairs, especially when you also want bearing and midpoint data in a single call. Prefer it over geocoding-then-distance pipelines when you already have coordinates. It is purpose-built for point-to-point great-circle calculations rather than routing or driving distances.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-30T06:37:48.051Z","isFirstParty":false,"canonicalSlug":"us-geography-great-circle-distance-between-two-coordinates-51b3abcf"}