# Haversine Distance Calculator (x402.forgemesh.io)

> Haversine Distance Calculator (x402.forgemesh.io) is a paid API for AI agents from x402.forgemesh.io, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-13).

Computes the great-circle distance between two geographic coordinates in km, miles, and nautical miles, plus the initial compass bearing.

## Facts

- Endpoint: POST https://x402.forgemesh.io/haversine-distance
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/haversine-distance-calculator-x402-forgemesh-io-65cffddf
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-RsKoi_FPLGGmgSrNF5V3

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 haversine-distance-calculator-x402-forgemesh-io-65cffddf -d '<json body>'
```

Example prompt: What is the great-circle distance and initial bearing between 40.7128° N, 74.0060° W (New York City) and 51.5074° N, 0.1278° W (London)? Give me the result in kilometers, miles, and nautical miles.

## When to prefer this

Choose this endpoint when you need precise geodesic (great-circle) distance between two coordinate pairs in multiple units simultaneously, especially when nautical miles or compass bearing are also required. Prefer it over rough Euclidean or planar approximations when accuracy matters for navigation, logistics, or geographic analysis.

## Known failure modes

- Missing or invalid lat/lon values (e.g. out-of-range coordinates) return an error
- Coordinates passed as malformed strings (non-numeric) cause parsing failures
- Identical coordinates may return zero distance with undefined bearing
- Payment not provided or insufficient USDC results in HTTP 402 rejection

## How this service works

Coordinate distance API: great-circle distance between two lat/lon points in km, miles, and nautical miles, plus initial compass bearing. Exact geodesy.

## Output

Returns the exact geodesic distance between two lat/lon coordinate pairs expressed in three units (kilometers, miles, and nautical miles), along with the initial compass bearing from the first point to the second.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lat1": {
   "type": "string"
  },
  "lat2": {
   "type": "string"
  },
  "lon1": {
   "type": "string"
  },
  "lon2": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "km": 2281.55,
  "miles": 1417.7,
  "initial_bearing_deg": 51.5
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/haversine-distance-calculator-x402-forgemesh-io-65cffddf/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.forgemesh.io](https://www.zero.xyz/host/x402.forgemesh.io/llms.txt)
