# Great-Circle Distance Calculator (km, miles, bearing, midpoint)

> Great-Circle Distance Calculator (km, miles, bearing, midpoint) is a paid API for AI agents from agent-data-tools.revmesh2074.workers.dev, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-30).

Computes the great-circle distance between two lat/lon points in km, miles, and nautical miles, plus the initial compass bearing and geographic midpoint using the haversine formula.

## Facts

- Endpoint: GET https://agent-data-tools.revmesh2074.workers.dev/geo/distance?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Provider: agent-data-tools.revmesh2074.workers.dev
- Website: https://agent-data-tools.revmesh2074.workers.dev
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-great-circle-distance-49fbe697
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_lCl2nk1hMoz3RfaGJksCy

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 agent-data-tools-revmesh2074-workers-dev-great-circle-distance-49fbe697
```

Example prompt: How far is it from New York City (40.7128, -74.0060) to London (51.5074, -0.1278) in kilometres and miles, and what's the compass bearing and midpoint?

## When to prefer this

Choose this endpoint when you need fast, accurate great-circle distance calculations between two known coordinate pairs without the overhead of a full mapping API. Ideal for delivery radius checks, proximity sorting, travel distance estimates, and navigation bearing — especially when coordinates are already known. If you need to convert a place name to coordinates first, use a geocoding endpoint before calling this. Prefer this over a full routing API when you need straight-line (as-the-crow-flies) distance rather than road distance.

## Known failure modes

- Missing required parameter (lat1, lon1, lat2, or lon2) returns an error
- Latitude values outside -90 to 90 or longitude outside -180 to 180 cause validation errors
- Non-numeric coordinate values result in a parse or type error
- Identical coordinates return zero distance with an undefined or zero bearing

## How this service works

Great-circle distance between two latitude/longitude points (haversine on the mean earth radius) in kilometres, miles and nautical miles, plus the initial compass bearing and the midpoint. Accurate to about 0.5% against the ellipsoid. Use for delivery radius, travel and proximity checks, or sorting places by distance; for coordinates of a place name use geocode first.

## Output

Returns a JSON object containing the distance in kilometres (km), miles, and nautical miles, the initial compass bearing as a decimal degree number and a human-readable compass direction string (e.g. 'NNE'), and the geographic midpoint as a lat/lon object. Accurate to approximately 0.5% relative to the WGS-84 ellipsoid.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "lat1",
  "lon1",
  "lat2",
  "lon2"
 ],
 "properties": {
  "lat1": {
   "type": "number",
   "description": "Latitude of the first point (-90 to 90)"
  },
  "lat2": {
   "type": "number",
   "description": "Latitude of the second point"
  },
  "lon1": {
   "type": "number",
   "description": "Longitude of the first point (-180 to 180)"
  },
  "lon2": {
   "type": "number",
   "description": "Longitude of the second point"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "km": {
   "type": "number"
  },
  "miles": {
   "type": "number"
  },
  "bearing": {
   "type": "number"
  },
  "compass": {
   "type": "string"
  },
  "midpoint": {
   "type": "object",
   "properties": {
    "lat": {
     "type": "number"
    },
    "lon": {
     "type": "number"
    }
   }
  },
  "nauticalMiles": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-data-tools-revmesh2074-workers-dev-great-circle-distance-49fbe697/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent-data-tools.revmesh2074.workers.dev](https://www.zero.xyz/host/agent-data-tools.revmesh2074.workers.dev/llms.txt)
