# Haversine Coordinates Distance & Bearing Calculator

> Haversine Coordinates Distance & Bearing Calculator 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 straight-line haversine distance and compass bearing between two lat/lon coordinate pairs, returning results in km, miles, and nautical miles.

## Facts

- Endpoint: POST https://x402.forgemesh.io/coordinates-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-coordinates-distance-bearing-calculator-663bc008
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_wRIurHZHwUs-Tj9SyWCox

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-coordinates-distance-bearing-calculator-663bc008 -d '<json body>'
```

Example prompt: What's the straight-line distance and compass bearing between coordinates 40.7128, -74.0060 and 51.5074, -0.1278? Give me the result in km, miles, and nautical miles.

## When to prefer this

Use this endpoint when you have raw latitude/longitude coordinate pairs and need fast, accurate straight-line distance and bearing calculations without geocoding overhead. Ideal for geofencing checks, routing pre-filters, travel-time estimation inputs, or any mapping agent that already has coordinates rather than place names.

## Known failure modes

- Missing or malformed lat/lon values result in a validation error
- Out-of-range coordinate values (e.g. lat outside -90 to 90) may cause errors
- Non-numeric strings passed for coordinate fields will fail parsing
- Identical coordinates may return zero distance and undefined or zero bearing
- Payment failure or insufficient USDC balance returns a 402 error

## How this service works

Computes straight-line haversine distance and compass bearing between any two latitude/longitude points, returned in km, miles, and nautical miles. Useful for geofencing checks, travel-time estimation inputs, and mapping agents working from raw coordinate pairs rather than place names.

## Output

Returns the haversine (great-circle) straight-line distance between the two coordinate pairs expressed in kilometers, miles, and nautical miles, along with the compass bearing from point 1 to point 2.

## 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-coordinates-distance-bearing-calculator-663bc008/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)
