# GPS Distance & Bearing Calculator

> GPS 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).

Calculates the great-circle distance between two GPS coordinates in kilometers, miles, and nautical miles, plus the initial compass bearing from point A to point B.

## Facts

- Endpoint: POST https://x402.forgemesh.io/gps-distance-calculator
- 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/gps-distance-bearing-calculator-0dcb7a6f
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_atXti-dnPQc0TFiMzd3w5

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 gps-distance-bearing-calculator-0dcb7a6f -d '<json body>'
```

Example prompt: What's the exact great-circle distance and initial bearing from 40.7128° N, 74.0060° W (New York) to 51.5074° N, 0.1278° W (London)?

## When to prefer this

Use this endpoint when you need a precise geodesic (great-circle) distance and directional bearing between two known GPS coordinates, especially for logistics routing, flight-distance estimation, delivery cost calculation, or any agent workflow that requires an exact numeric distance rather than an approximation. It returns results in all three common distance units simultaneously, saving conversion steps.

## Known failure modes

- Missing or invalid latitude/longitude values — returns an error if any of the four coordinates are absent or non-numeric
- Out-of-range coordinates (latitude outside -90 to 90, longitude outside -180 to 180) may return an error or unexpected result
- Both points identical — may return zero distance and undefined bearing
- Payment failure — x402 micropayment not completed, returns 402 response

## How this service works

Calculates the great-circle distance between two GPS coordinates in kilometers, miles, and nautical miles, plus the initial compass bearing from point A to point B. For delivery routing, flight-distance estimates, and logistics agents that need an exact figure rather than an eyeballed map distance.

## Output

Returns the great-circle distance between the two GPS coordinates expressed in kilometers, miles, and nautical miles, along with the initial compass bearing (in degrees) from point A to point B.

## 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/gps-distance-bearing-calculator-0dcb7a6f/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)
