# CoCo Distance Calculator

> CoCo Distance Calculator is a paid API for AI agents from cocoeatsai.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Computes the geodesic distance between two geographic coordinates, returning results in kilometers, miles, nautical miles, and initial bearing.

## Facts

- Endpoint: GET https://cocoeatsai.com/area4/agent/tools/distance?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coco-distance-calculator-2c80647b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BYgbRNINhLns1g_7ABGJF

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 coco-distance-calculator-2c80647b
```

Example prompt: How far apart are the coordinates 40.7128° N, 74.0060° W and 42.3601° N, 71.0589° W? Give me the distance in km, miles, and nautical miles along with the initial bearing.

## When to prefer this

Choose this endpoint when you need a quick, paid geodesic distance computation between two lat/lon coordinate pairs and want results in multiple units (km, miles, nautical miles) plus bearing in a single call. Ideal for lightweight geospatial calculations without requiring a full-featured mapping API.

## Known failure modes

- Missing required query parameters (lat1, lon1, lat2, lon2) — likely returns an error or empty response
- Out-of-range latitude/longitude values (e.g. lat > 90) may produce incorrect or error results
- Non-numeric string values passed for coordinate parameters may cause a parsing error
- Payment failure (x402) if USDC balance is insufficient

## How this service works

Zach Riehn's lab: an about-me and portfolio, a news desk, The Atelier for AI experiments, Launch Lab for XRP research, and Fracture for games.

## Output

A JSON object containing the computed distance between the two coordinate pairs expressed in kilometers (km), miles, and nautical miles, plus the initial bearing in degrees from the first point toward the second.

## Request schema (JSON Schema)

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

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "km": 106.012,
  "miles": 65.873,
  "nautical_miles": 57.242,
  "initial_bearing_deg": 340.9
 },
 "exampleNote": "Computed offline with demonstration inputs; time/random values are illustrative."
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coco-distance-calculator-2c80647b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from cocoeatsai.com](https://www.zero.xyz/host/cocoeatsai.com/llms.txt)
