# Geo Distance (Haversine)

> Geo Distance (Haversine) is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-30).

Computes the great-circle distance between two geographic coordinates using the haversine formula, returning the result in km, miles, or nautical miles.

## Facts

- Endpoint: GET https://x402.agentindex.world/geo/distance?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/geo-distance-haversine-4cdfb71d
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_2mrXFCiV4Brxte-HPDgC8

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 geo-distance-haversine-4cdfb71d
```

Example prompt: What's the great-circle distance in miles between 51.5074, -0.1278 (London) and 48.8566, 2.3522 (Paris)?

## When to prefer this

Choose this endpoint when you need a fast, cheap, single-call great-circle distance between two coordinate pairs without needing routing, road distances, or map tiles. Ideal for filtering, proximity checks, or any computation that only requires straight-line geographic distance.

## Known failure modes

- Latitude out of range [-90, 90] returns a validation error
- Longitude out of range [-180, 180] returns a validation error
- Invalid unit string (not km, mi, or nm) returns a validation error
- Missing required lat1/lon1/lat2/lon2 parameters causes a 422 error
- Payment failure (insufficient USDC balance) returns 402 Payment Required

## How this service works

Great-circle distance between two lat/lon points (haversine formula). Returns km, mi or nm.

## Output

A numeric distance value between the two specified coordinates expressed in the requested unit (km, mi, or nm), computed via the haversine great-circle formula.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lat1": {
   "type": "number",
   "title": "Lat1",
   "maximum": 90,
   "minimum": -90
  },
  "lat2": {
   "type": "number",
   "title": "Lat2",
   "maximum": 90,
   "minimum": -90
  },
  "lon1": {
   "type": "number",
   "title": "Lon1",
   "maximum": 180,
   "minimum": -180
  },
  "lon2": {
   "type": "number",
   "title": "Lon2",
   "maximum": 180,
   "minimum": -180
  },
  "unit": {
   "type": "string",
   "title": "Unit",
   "default": "km",
   "pattern": "^(km|mi|nm)$"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "unit": "km",
  "distance": 343.5577
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/geo-distance-haversine-4cdfb71d/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
