{"uid":"cap_cPzp2B530cLP9hdJaen9W","slug":"boring-api-geo-distance-matrix-ebc7acd3","name":"boring-api · geo — Distance Matrix","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-matrix","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"origins":{"type":"array"},"destinations":{"type":"array"}}},"responseSchema":{"type":"object"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_HZr-pB6qTlXRW_wkJPXuf","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes a matrix of geodesic distances and bearings between multiple origin and destination coordinate pairs using pure in-Worker spatial math, with no external API calls.","exampleAgentPrompt":"Compute the distance matrix between these three origins — (40.7128, -74.0060), (34.0522, -118.2437), (41.8781, -87.6298) — and these two destinations — (51.5074, -0.1278) and (48.8566, 2.3522) — so I can see how far each city is from London and Paris.","exampleUseCases":null,"resultDescription":"Returns a matrix object containing pairwise computed distances (and likely bearings) between every origin and destination coordinate pair, all calculated in-Worker without external API calls. The response covers all combinations of the supplied origins and destinations arrays.","failureModes":["Missing or malformed origins/destinations arrays returns a 400 error","Non-numeric or out-of-range latitude/longitude values cause a validation error","Empty origins or destinations array may return an empty matrix or error","Payment not included or insufficient USDC triggers a 402 Payment Required response","Exceeding array size limits may cause a timeout or 413 error"],"whenToPreferThis":"Choose this endpoint when you need to compute distances between many pairs of coordinates in a single request without relying on Google Maps, Mapbox, or other external geocoding APIs. It is ideal for logistics, routing, or optimization tasks where you already have lat/lon coordinates and need a full N×M distance matrix computed quickly and cheaply. Prefer it over single-pair distance endpoints when you need all pairwise combinations at once.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-13T18:41:48.296Z","isFirstParty":false}