# boring-api · geo · Distance

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

Computes the geodesic distance between two geographic points using pure in-Worker spatial math, with no external API calls.

## Facts

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

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-69540f21 -d '<json body>'
```

Example prompt: What's the distance between 40.7128° N, 74.0060° W (New York City) and 51.5074° N, 0.1278° W (London)?

## When to prefer this

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.

## Known failure modes

- 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

## 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 computed distance value between the two input geographic points, calculated entirely in-Worker using spatial math algorithms without any external API dependency.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "to": {
   "type": "object"
  },
  "from": {
   "type": "object"
  }
 }
}
```

## Response schema (JSON Schema)

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

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/boring-api-geo-distance-69540f21/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)
