# Geospatial Distance and Bearing Calculator

> Geospatial Distance and Bearing Calculator is a paid API for AI agents from geospatial.openverbs.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-09-15).

Computes the great-circle distance and initial bearing between two WGS84 lat/lon coordinates.

## Facts

- Endpoint: POST https://geospatial.openverbs.com/v1/distance
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/geospatial-distance-and-bearing-calculator-eaae35fa
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_45JNrC0q3NwctMnGmUyim

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 geospatial-distance-and-bearing-calculator-eaae35fa -d '<json body>'
```

Example prompt: What's the distance and initial bearing from 40.7128° N, 74.0060° W (New York City) to 51.5074° N, 0.1278° W (London)?

## When to prefer this

Use this endpoint when you need a fast, cheap ($0.002/call) programmatic computation of point-to-point geodesic distance and bearing from raw coordinates, without needing routing, roads, or address geocoding. Prefer it over full mapping APIs when you already have lat/lon values and just need the angular and linear relationship between two points.

## Known failure modes

- Latitude or longitude out of valid range (lat: -90 to 90, lon: -180 to 180) returns a validation error
- Missing required 'from' or 'to' fields causes a 400 bad request
- Identical origin and destination may return distance 0 and undefined or null bearing
- Network timeout or service unavailability returns a 5xx error
- Payment failure via x402 protocol results in a 402 Payment Required response

## How this service works

Distance and initial bearing between two coordinates.

## Output

Returns the great-circle (haversine or Vincenty) distance between the two coordinates (likely in kilometers or meters) and the initial compass bearing in degrees from the origin toward the destination.

## 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",
    "bodyType",
    "body"
   ],
   "properties": {
    "body": {
     "type": "object",
     "required": [
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "object",
       "required": [
        "lat",
        "lon"
       ],
       "properties": {
        "lat": {
         "type": "number",
         "maximum": 90,
         "minimum": -90
        },
        "lon": {
         "type": "number",
         "maximum": 180,
         "minimum": -180
        }
       },
       "description": "Destination coordinate.",
       "additionalProperties": false
      },
      "from": {
       "type": "object",
       "required": [
        "lat",
        "lon"
       ],
       "properties": {
        "lat": {
         "type": "number",
         "maximum": 90,
         "minimum": -90
        },
        "lon": {
         "type": "number",
         "maximum": 180,
         "minimum": -180
        }
       },
       "description": "Origin coordinate.",
       "additionalProperties": false
      }
     },
     "additionalProperties": false
    },
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "POST"
     ],
     "type": "string"
    },
    "bodyType": {
     "enum": [
      "json",
      "form-data",
      "text"
     ],
     "type": "string"
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/geospatial-distance-and-bearing-calculator-eaae35fa/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from geospatial.openverbs.com](https://www.zero.xyz/host/geospatial.openverbs.com/llms.txt)
