# boring-api · geo — Distance Matrix

> boring-api · geo — Distance Matrix is a paid API for AI agents from geo.boring-api.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-13).

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.

## Facts

- Endpoint: POST https://geo.boring-api.com/distance-matrix
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/boring-api-geo-distance-matrix-ebc7acd3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cPzp2B530cLP9hdJaen9W

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability boring-api-geo-distance-matrix-ebc7acd3 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Pure-library spatial math and timezone lookup. Distance, bearing, polygons, point-in-polygon, timezone-by-coords. No external API calls — all computed in-Worker.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "origins": {
   "type": "array"
  },
  "destinations": {
   "type": "array"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/boring-api-geo-distance-matrix-ebc7acd3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from geo.boring-api.com](https://www.zero.xyz/host/geo.boring-api.com/llms.txt)
