# SiteCheck Distance Calculator

> SiteCheck Distance Calculator is a paid API for AI agents from api.sitecheck-api.workers.dev, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-19).

Calculates the straight-line (haversine) distance and bearing between two locations, accepting either coordinates or place names

## Facts

- Endpoint: GET https://api.sitecheck-api.workers.dev/api/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/sitecheck-distance-calculator-81531d11
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_mKBADbKxepE8rUFqLsc68

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 sitecheck-distance-calculator-81531d11
```

Example prompt: How far is it from Berlin to Istanbul in kilometers and miles, and what's the initial compass bearing?

## When to prefer this

Use this endpoint when you need a quick, pay-per-call great-circle (crow-flies) distance between any two points or named places without setting up a full mapping SDK. It is ideal when you need both distance units (km and miles), bearing, and midpoint in a single call, and when accepting place names as input (not just coordinates) is important.

## Known failure modes

- Unrecognizable place name returns an error or null geocoding result from Nominatim
- Missing required 'from' or 'to' query parameters returns a validation error
- Ambiguous place names may resolve to unexpected locations (e.g. 'Springfield' without country context)
- Network timeout or Nominatim rate limit may cause geocoding failure

## How this service works

The great-circle distance between two points in km and miles, the initial bearing and the midpoint. Each point is a lat,lon pair or a place name (geocoded with OpenStreetMap data, ODbL). Straight-line distance only, not a route.

## Output

A JSON object containing: geocoded labels and coordinates for both the from and to locations, distance in kilometers and miles, initial bearing in degrees, midpoint latitude/longitude, the calculation method (haversine on a 6371 km sphere), and a timestamp of when the calculation was performed.

## 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": [
      "from",
      "to"
     ],
     "properties": {
      "to": {
       "type": "string",
       "description": "lat,lon or a place name"
      },
      "from": {
       "type": "string",
       "description": "lat,lon or a place name"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "to": {
   "lat": 41.006381,
   "lon": 28.9758715,
   "label": "İstanbul, Fatih, İstanbul, Marmara Bölgesi, 34122, Türkiye"
  },
  "from": {
   "lat": 52.5173885,
   "lon": 13.3951309,
   "label": "Berlin, Deutschland"
  },
  "source": "haversine on a 6371 km sphere; place names from OpenStreetMap (Nominatim, ODbL)",
  "midpoint": {
   "lat": 47.02386,
   "lon": 22.02567
  },
  "checkedAt": "2026-10-14T07:00:47.494Z",
  "distanceKm": 1738.21,
  "distanceMiles": 1080.07,
  "initialBearingDeg": 131.2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sitecheck-distance-calculator-81531d11/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.sitecheck-api.workers.dev](https://www.zero.xyz/host/api.sitecheck-api.workers.dev/llms.txt)
