# Agent402 UK Haversine Great-Circle Distance

> Agent402 UK Haversine Great-Circle Distance is a paid API for AI agents from agent402.co.uk, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-10).

Computes the straight-line great-circle distance between two lat/lon coordinate pairs using the Haversine formula, returning the result in km or miles.

## Facts

- Endpoint: GET https://agent402.co.uk/v1/geo/distance?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-10
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-uk-haversine-great-circle-distance-eb6289c4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nNXtjo_SpPCHnDr7UtWrk

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 agent402-uk-haversine-great-circle-distance-eb6289c4
```

Example prompt: What's the straight-line great-circle distance in kilometers between London (51.5074, -0.1278) and Paris (48.8566, 2.3522)?

## When to prefer this

Use this endpoint when you need a fast, cheap, mathematically exact great-circle (as-the-crow-flies) distance between two lat/lon points for logistics pre-screening, zone classification, or geographic filtering. Prefer it over road-routing APIs when road distance is not needed and over manual Haversine implementations when you want a reliable, hosted computation. Not suitable when turn-by-turn or road-network distance is required.

## Known failure modes

- Missing required query parameter (lat1, lon1, lat2, lon2) returns an error response
- Invalid or out-of-range coordinate values (e.g. lat > 90) may return valid:false
- Unrecognized unit value may default to km or return an error
- Network or service unavailability returns a non-200 HTTP status
- Payment failure (402) if USDC micropayment is not resolved

## How this service works

Don't burn tokens on deterministic work. Go/no-go jobs first: payout preflight, text firewall (PII/secrets), budget check — then rails, calendars, finmath. x402 USDC on Base. UK + global. agent402.co.uk — not agent402.tools. $0.001–$0.002 USDC on Base. No API keys.

## Output

A JSON object containing the numeric distance value, the unit used (km or mi), and a validity flag indicating whether the input coordinates were valid and the computation succeeded.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "lat1",
      "lon1",
      "lat2",
      "lon2"
     ],
     "properties": {
      "lat1": {
       "type": "string",
       "description": "Origin lat"
      },
      "lat2": {
       "type": "string",
       "description": "Dest lat"
      },
      "lon1": {
       "type": "string",
       "description": "Origin lon"
      },
      "lon2": {
       "type": "string",
       "description": "Dest lon"
      },
      "unit": {
       "type": "string",
       "description": "km|mi"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "unit": "km",
  "valid": true,
  "distance": 343
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-uk-haversine-great-circle-distance-eb6289c4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.co.uk](https://www.zero.xyz/host/agent402.co.uk/llms.txt)
