# Geo Distance Calculator (Haversine / Great-Circle)

> Geo Distance Calculator (Haversine / Great-Circle) is a paid API for AI agents from api.cn402.com, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-15).

Computes the great-circle (haversine) distance between two latitude/longitude coordinate pairs on Earth.

## Facts

- Endpoint: GET https://api.cn402.com/geo/distance
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/api-cn402-com-97067d9e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_263Cz1D90j8pKHlWiCAHl

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 api-cn402-com-97067d9e
```

Example prompt: What's the great-circle distance in kilometers between Tokyo (35.6895° N, 139.6917° E) and Sydney (-33.8688° S, 151.2093° E)?

## When to prefer this

Use this endpoint when you need a fast, accurate haversine/great-circle distance calculation between two GPS coordinate pairs and want a simple pay-per-call API without setting up a geospatial library. Ideal for AI agents needing on-the-fly geographic distance computation without local math dependencies.

## Known failure modes

- Invalid or out-of-range latitude/longitude values (e.g. lat > 90 or < -90) return an error
- Missing required coordinate fields return a validation error
- Malformed JSON body returns a 400 Bad Request
- Payment failure or insufficient USDC balance blocks the request with a 402 Payment Required

## How this service works

Geographic distance calculation between two coordinates using haversine formula. Computes great circle distance from latitude longitude pairs. Returns distance in kilometers, miles, and meters. For mapping, navigation, GPS coordinate distance, location based queries, Chinese maps, geo analytics, route planning, proximity search.

## Output

Returns the computed great-circle (haversine) distance between two coordinate pairs, expressed in kilometers, representing the shortest path along the Earth's surface between those two points.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lat1": {
   "type": "string",
   "description": "Lat1 (optional)"
  },
  "lat2": {
   "type": "string",
   "description": "Lat2 (optional)"
  },
  "lng1": {
   "type": "string",
   "description": "Lng1 (optional)"
  },
  "lng2": {
   "type": "string",
   "description": "Lng2 (optional)"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/api-cn402-com-97067d9e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.cn402.com](https://www.zero.xyz/host/api.cn402.com/llms.txt)
