{"uid":"cap_tX5QMAfbdbjVdRMieA24N","slug":"boring-api-geo-distance-69540f21","name":"boring-api · geo · Distance","description":"Pure-library spatial math and timezone lookup. Distance, bearing, polygons, point-in-polygon, timezone-by-coords. No external API calls — all computed in-Worker.","url":"https://geo.boring-api.com/distance","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"to":{"type":"object"},"from":{"type":"object"}}},"responseSchema":{"type":"object"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.0005","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.0005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.0005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UbO9Bv4tw5VnrWbrtWYrE","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.0005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes the geodesic distance between two geographic points using pure in-Worker spatial math, with no external API calls.","exampleAgentPrompt":"What's the distance between 40.7128° N, 74.0060° W (New York City) and 51.5074° N, 0.1278° W (London)?","exampleUseCases":[{"title":"Nearest warehouse to customer","prompt":"I have a customer at 37.7749° N, 122.4194° W in San Francisco and three warehouses at 34.0522° N, 118.2437° W (LA), 47.6062° N, 122.3321° W (Seattle), and 33.4484° N, 112.0740° W (Phoenix). Which warehouse is closest to the customer?"},{"title":"Delivery radius eligibility check","prompt":"A restaurant is located at 51.5074° N, 0.1278° W in London. A customer at 51.5200° N, 0.1100° W wants to order — can you check if they're within 3 kilometers so we know if delivery is available?"},{"title":"Flight path distance estimation","prompt":"How far is it in kilometers between Sydney at 33.8688° S, 151.2093° E and Tokyo at 35.6762° N, 139.6503° E? I'm trying to estimate the straight-line distance for a rough flight time calculation."}],"resultDescription":"Returns a computed distance value between the two input geographic points, calculated entirely in-Worker using spatial math algorithms without any external API dependency.","failureModes":["Missing or malformed 'from' or 'to' objects — returns 400 Bad Request","Invalid coordinate values (e.g. latitude out of -90/90 range) — likely returns a validation error","Missing latitude/longitude fields inside the point objects — computation cannot proceed"],"whenToPreferThis":"Use this endpoint when you need fast, serverless, no-external-dependency geodesic distance computation between two geographic coordinate pairs. Ideal for agents that need spatial math in real time without relying on mapping APIs like Google Maps or Mapbox. Especially suited for low-latency, pay-per-call workflows where a flat $0.0005 per call is acceptable and privacy or external API key constraints matter.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T18:30:52.413Z","isFirstParty":false}