# WritersLogic Geo-Distance Calculator (Haversine + Vincenty)

> WritersLogic Geo-Distance Calculator (Haversine + Vincenty) is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Computes haversine and Vincenty inverse geodesic distances in metres plus initial and final bearings for up to 100 coordinate pairs, with optional claimed-distance verification against a tolerance.

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/geo-distance?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-geo-distance-calculator-haversine-vincenty-5b3aa96c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_vIIKrI_NpHeYWjPeKMz0f

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 writerslogic-geo-distance-calculator-haversine-vincenty-5b3aa96c -d '<json body>'
```

Example prompt: Calculate the Vincenty and haversine distances between New York (40.7128° N, 74.0060° W) and London (51.5074° N, 0.1278° W), and check whether the claimed distance of 5,570,000 metres is correct within a 1000-metre tolerance.

## When to prefer this

Choose this endpoint when you need precise geodesic distances between raw WGS-84 coordinates without road routing or geocoding. It is ideal for verifying claimed distances, batch-processing up to 100 pairs in a single call, or when millimetre-level ellipsoidal accuracy (Vincenty) is required alongside a faster spherical approximation (haversine). Prefer this over general mapping APIs when you have raw lat/lon and need a lightweight, deterministic distance computation with optional claim validation.

## Known failure modes

- Nearly antipodal coordinate pairs cause Vincenty to fail to converge — vincentyMeters will be null and status set to 'unknown', with haversine used as fallback (up to ~0.5% error)
- More than 100 coordinate pairs submitted — request rejected with validation error
- Invalid latitude (outside -90 to 90) or longitude (outside -180 to 180) — schema validation failure
- claimedMeters provided without claimBasis defaults to Vincenty, which may be null for antipodal pairs causing ambiguous verification
- toleranceMeters outside 0–100000 range — schema validation error
- Missing required 'from' or 'to' fields in a pair — validation error per item

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

For each coordinate pair, the API returns the haversine distance in metres, the Vincenty distance in metres (or null if the pair is nearly antipodal), initial and final bearings in degrees, and a convergence status. If claimedMeters was provided, also returns whether the claim passes or fails against the specified basis and tolerance. The echoed label is returned for each pair if supplied.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "pairs": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "from",
     "to"
    ],
    "properties": {
     "to": {
      "type": "object",
      "required": [
       "latitude",
       "longitude"
      ],
      "properties": {
       "latitude": {
        "type": "number",
        "maximum": 90,
        "minimum": -90,
        "description": "Degrees north, -90 to 90."
       },
       "longitude": {
        "type": "number",
        "maximum": 180,
        "minimum": -180,
        "description": "Degrees east, -180 to 180."
       }
      }
     },
     "from": {
      "type": "object",
      "required": [
       "latitude",
       "longitude"
      ],
      "properties": {
       "latitude": {
        "type": "number",
        "maximum": 90,
        "minimum": -90,
        "description": "Degrees north, -90 to 90."
       },
       "longitude": {
        "type": "number",
        "maximum": 180,
        "minimum": -180,
        "description": "Degrees east, -180 to 180."
       }
      }
     },
     "label": {
      "type": "string",
      "maxLength": 80,
      "description": "Caller label echoed back."
     },
     "claimedMeters": {
      "type": "number",
      "maximum": 21000000,
      "minimum": 0,
      "description": "Optional distance to verify, metres."
     }
    }
   },
   "maxItems": 100,
   "minItems": 1,
   "description": "Coordinate pairs."
  },
  "claimBasis": {
   "enum": [
    "vincenty",
    "haversine"
   ],
   "type": "string",
   "description": "Which distance claimedMeters is compared against (default vincenty)."
  },
  "toleranceMeters": {
   "type": "number",
   "maximum": 100000,
   "minimum": 0,
   "description": "Allowed difference for claimedMeters (default 1)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-geo-distance-calculator-haversine-vincenty-5b3aa96c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
