# geo402 Great-Circle Distance

> geo402 Great-Circle Distance is a paid API for AI agents from geo402.alogos.xyz, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-15).

Calculates the great-circle (shortest spherical) distance between two geographic coordinates, returning the result in the specified unit.

## Facts

- Endpoint: GET https://geo402.alogos.xyz/v1/distance
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/geo402-great-circle-distance-163dd07a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_a46KwcXN7NlRSjYQeMrg2

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 geo402-great-circle-distance-163dd07a
```

Example prompt: What's the great-circle distance in kilometers between New York City (40.7128° N, 74.0060° W) and London (51.5074° N, 0.1278° W)?

## When to prefer this

Use this endpoint when an AI agent needs a fast, lightweight, pay-per-call computation of the straight-line (great-circle) distance between two known coordinate pairs, without needing geocoding or address resolution. Ideal for scenarios where coordinates are already known and only the distance metric is needed. Prefer over subscription-based geospatial APIs when usage is occasional or cost-per-call billing is preferred.

## Known failure modes

- Missing required parameters (lat1, lon1, lat2, lon2) returns a 400 error
- Out-of-range latitude (outside -90 to 90) or longitude (outside -180 to 180) may return a validation error
- Invalid or unsupported unit string may fall back to a default unit or return an error
- Payment not provided or insufficient USDC/pathUSD triggers a 402 Payment Required response
- Network timeout or server unavailability returns a 5xx error

## How this service works

Pay-per-call geolocation utility for AI agents: geocoding, reverse geocoding, timezone lookup, and great-circle distance. No API key, no subscription — agents pay per request via x402 (Base/USDC) or MPP (Tempo/pathUSD).

## Output

Returns the computed great-circle distance between the two coordinate pairs, expressed in the requested unit (e.g., kilometers, miles, or nautical miles). The response is a numeric distance value along the shortest spherical path between the two points.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "lat1",
  "lat2",
  "lon1",
  "lon2"
 ],
 "properties": {
  "lat1": {
   "type": "number",
   "description": "Start latitude in decimal degrees."
  },
  "lat2": {
   "type": "number",
   "description": "Destination latitude in decimal degrees."
  },
  "lon1": {
   "type": "number",
   "description": "Start longitude in decimal degrees."
  },
  "lon2": {
   "type": "number",
   "description": "Destination longitude in decimal degrees."
  },
  "unit": {
   "enum": [
    "km",
    "mi",
    "m",
    "nmi"
   ],
   "type": "string",
   "description": "Distance unit: kilometers, miles, meters, or nautical miles."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "lat1": {
   "type": "number"
  },
  "lat2": {
   "type": "number"
  },
  "lon1": {
   "type": "number"
  },
  "lon2": {
   "type": "number"
  },
  "unit": {
   "type": "string"
  },
  "bearing": {
   "type": "number"
  },
  "distance": {
   "type": "number"
  },
  "distanceKm": {
   "type": "number"
  },
  "distanceMi": {
   "type": "number"
  }
 },
 "additionalProperties": true
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/geo402-great-circle-distance-163dd07a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from geo402.alogos.xyz](https://www.zero.xyz/host/geo402.alogos.xyz/llms.txt)
