{"uid":"cap_sUb6ZBcl1F5T8vKhXkY-F","slug":"duo-data-utilities-geodesic-distance-navigation-1be1b1c0","name":"Duo Data Utilities – Geodesic Distance & Navigation","description":"Distance and direction between WGS-84 coordinates: geodesic distance by Vincenty with a haversine fallback, initial and final bearing, the midpoint, and the destination point reached from a start point on a given bearing and distance. Also computes the cumulative length of a supplied coordinate path. Results in metres, kilometres, nautical miles and miles.","url":"https://api.duoleads.com/v1/geo/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":[],"properties":{"op":{"enum":["distance","destination","midpoint","path"],"type":"string","default":"distance","maxLength":64,"description":"distance (default), destination, midpoint or path."},"lat1":{"type":"string","pattern":"^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$","maxLength":64,"description":"Start latitude."},"lat2":{"type":"string","pattern":"^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$","maxLength":64,"description":"End latitude."},"lon1":{"type":"string","pattern":"^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$","maxLength":64,"description":"Start longitude."},"lon2":{"type":"string","pattern":"^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$","maxLength":64,"description":"End longitude."},"path":{"type":"string","maxLength":2048,"description":"Comma-separated lat,lon pairs for op=path, at most 200 points."},"method":{"enum":["vincenty","haversine"],"type":"string","default":"vincenty","maxLength":64,"description":"vincenty (default, WGS-84) or haversine."},"bearing":{"type":"string","pattern":"^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$","maxLength":64,"description":"Initial bearing in degrees for op=destination."},"distance_m":{"type":"string","pattern":"^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][+-]?\\d+)?$","maxLength":64,"description":"Distance in metres for op=destination, 0 to 1e9 (about 25 Earth circumferences); larger values are 400 INVALID_PARAM."}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["ok","route","version","data","meta"],"properties":{"ok":{"const":true},"data":{"type":"object","required":["method","converged"],"properties":{"legs":{"type":"integer"},"method":{"type":"string"},"points":{"type":"integer"},"distance":{"type":"object","required":["m","km","nmi","mi"],"properties":{"m":{"type":"number"},"km":{"type":"number"},"mi":{"type":"number"},"nmi":{"type":"number"}}},"midpoint":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"number"},"lon":{"type":"number"}}},"converged":{"type":"boolean"},"destination":{"type":"object","required":["lat","lon"],"properties":{"lat":{"type":"number"},"lon":{"type":"number"}}},"bearing_final":{"type":"number"},"bearing_initial":{"type":"number"}}},"meta":{"type":"object","required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"properties":{"sources":{"type":"array","items":{"type":"object","required":["id","version","published"]}},"price_usd":{"type":"string"},"disclaimer":{"type":"string"},"request_id":{"type":"string"},"computed_at":{"type":"string","description":"RFC 3339 UTC with milliseconds"},"deterministic":{"type":"boolean"}}},"route":{"const":"/v1/geo/distance"},"version":{"type":"string"}}}}}}},"responseSchema":{"type":"json","example":{"ok":true,"data":{"method":"vincenty","distance":{"m":5878232.354,"km":5878.232354,"mi":3652.564246,"nmi":3173.991552},"midpoint":{"lat":53.7242681,"lon":-39.60892324},"converged":true,"bearing_final":228.8713,"bearing_initial":290.8461},"meta":{"price_usd":"0.05","disclaimer":"Factual output of a deterministic computation over public data. Provided as is, with no warranty of accuracy, completeness or availability. Not investment, financial, legal, tax, medical or any other professional advice, and not a recommendation. Verify before relying on it. Terms: https://api.duoleads.com/terms","request_id":"01K6B7Q4ZC8H3F2M9WXR5TYN0D","computed_at":"2026-09-28T12:00:00.000Z","deterministic":true},"route":"/v1/geo/distance","version":"1.0.0"}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.05","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.05/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.05","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_48U4zsKD7iwy8Q45blY_H","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.05","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes geodesic distance (Vincenty/haversine), initial and final bearing, midpoint, and destination point between WGS-84 coordinates, plus cumulative path length, in metres, km, nautical miles, and miles.","exampleAgentPrompt":"What's the geodesic distance and initial bearing from London (51.5074, -0.1278) to New York (40.7128, -74.0060) using Vincenty? Also give me the midpoint.","exampleUseCases":[{"title":"Flight route distance estimation","prompt":"Calculate the geodesic distance in kilometres and nautical miles from Sydney (lat -33.8688, lon 151.2093) to Dubai (lat 25.2048, lon 55.2708) using the Vincenty method, and tell me the initial bearing."},{"title":"GPS path total length","prompt":"I have a GPS track with these points: 48.8566,2.3522 then 51.5074,-0.1278 then 53.4808,-2.2426 — can you compute the total cumulative distance of this path in kilometres?"},{"title":"Find destination from bearing and distance","prompt":"Starting from coordinates 40.7128, -74.0060, if I travel on a bearing of 90 degrees for 500,000 metres, what are the destination coordinates?"}],"resultDescription":"Returns a JSON object with an 'ok' flag, a 'data' object containing the computed results (distance in m/km/mi/nmi, midpoint lat/lon, initial and final bearings, convergence status for Vincenty), and a 'meta' object with request ID, timestamp, price, and disclaimer. The exact fields in 'data' vary by operation (distance, midpoint, destination, or path).","failureModes":["Missing required lat1/lon1/lat2/lon2 for distance or midpoint operations returns a validation error","Vincenty algorithm fails to converge for nearly antipodal points — haversine fallback is used automatically","Invalid or out-of-range coordinate values (e.g. latitude > 90) return a 400 error","Path string malformed or exceeds 200 points returns a validation error","Missing bearing or distance_m for op=destination returns a parameter error"],"whenToPreferThis":"Choose this endpoint when you need precise ellipsoidal (WGS-84) geodesic computations — especially Vincenty accuracy for long-distance navigation, aviation, or maritime routing. Prefer it over simple flat-earth or haversine-only services when accuracy over thousands of kilometres matters, or when you need bearings, midpoints, and destination points together in one call with multi-unit output.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T00:46:20.925Z","isFirstParty":false,"canonicalSlug":"duo-data-utilities-geodesic-distance-navigation-1be1b1c0"}