Great-circle and WGS-84 ellipsoidal distance between coordinates

$0.005 USDC per call · Business, finance and compliance · POST /api/v1/geo-distance · Id geo-distance

Computes the haversine (IUGG mean-radius sphere) and Vincenty inverse (WGS-84 ellipsoid) distance in metres plus initial and final bearings for up to 100 coordinate pairs, and optionally checks a claimed distance within a tolerance. Vincenty is millimetre-accurate except for nearly antipodal pairs, where it does not converge: those pairs return vincentyMeters null, status unknown and the haversine value (up to about 0.5% off the ellipsoid). Does not geocode, route over roads, or account for altitude.

What you get

Gives agents a distance they can verify rather than estimate, with the method named.

Call it

Send the JSON body below to https://agents.writerslogic.com/api/v1/geo-distance. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.

curl -i -X POST https://agents.writerslogic.com/api/v1/geo-distance \
  -H 'content-type: application/json' \
  -d '{"pairs":[{"from":{"latitude":50.06632,"longitude":-5.71475},"to":{"latitude":58.64402,"longitude":-3.07009},"claimedMeters":969954.166,"label":"Land'\''s End to John o'\'' Groats"}]}'

Input

FieldTypeRequiredDescription
pairsarray<object>; max 100 itemsyesCoordinate pairs.
toleranceMetersnumber; 0..100000noAllowed difference for claimedMeters (default 1).
claimBasisstring; one of "vincenty", "haversine"noWhich distance claimedMeters is compared against (default vincenty).

Example request body

{
  "pairs": [
    {
      "from": {
        "latitude": 50.06632,
        "longitude": -5.71475
      },
      "to": {
        "latitude": 58.64402,
        "longitude": -3.07009
      },
      "claimedMeters": 969954.166,
      "label": "Land's End to John o' Groats"
    }
  ]
}

Result

The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.

FieldTypeRequiredDescription
statusstring; one of "pass", "fail", "unknown", "unsupported"nopass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass.
resultsarray<object>no
enginestringno
witnessesarray<object>no
versionsobjectnoEvery semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile).
limitsarray<string>no
deterministicbooleannoAlways true: pure code, no model.

Pay and connect

Available through: x402 (USDC on Base), MCP. MCP clients reach it through the physical-ops-kit package.

Machine-readable