# Agent Time & Place – Distance Calculator

> Agent Time & Place – Distance Calculator is a paid API for AI agents from time-place.agent-utils.workers.dev, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Calculates the geodesic distance between two locations (by coordinates or city name), returning km, miles, nautical miles, bearing, compass direction, and timezone offset difference.

## Facts

- Endpoint: GET https://time-place.agent-utils.workers.dev/v1/distance
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-time-place-distance-calculator-9bbf12ed
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_YpR_HJmSfQQewRvRlJMsB

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 agent-time-place-distance-calculator-9bbf12ed
```

Example prompt: How far is it from Lisbon to São Paulo — give me the distance in kilometers and miles, the compass direction, and the timezone difference between the two cities?

## When to prefer this

Choose this endpoint when you need a deterministic, sub-cent, keyless distance calculation between two points on Earth — especially when you also want bearing, compass direction, and timezone offset in a single call. Ideal for AI agents that need geospatial context without managing API keys; payment-as-authentication via x402 makes it frictionless for autonomous agents.

## Known failure modes

- Unresolvable city name returns a geocoding error
- Malformed 'lat,lon' string causes a 400 bad request
- Missing 'from' or 'to' query parameter causes a 422 validation error
- Payment not provided or insufficient triggers a 402 Payment Required response
- Rate or quota issues may return 429 or 503

## How this service works

Geocoding, timezones, holidays, business days, sun times, FX and distances for AI agents. Deterministic, sub-cent, no API key: payment is authentication (x402).

## Output

Returns a JSON object with the resolved 'from' and 'to' locations (name, lat, lon, timezone), distance in km, miles, and nautical miles, compass direction string (e.g. 'SW'), bearing in degrees, and the timezone offset difference in minutes between the two locations.

## 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 city name"
      },
      "from": {
       "type": "string",
       "description": "'lat,lon' or city name"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "km": {
       "type": "number"
      },
      "to": {
       "type": "object"
      },
      "from": {
       "type": "object"
      },
      "miles": {
       "type": "number"
      },
      "compass": {
       "type": "string"
      },
      "bearingDeg": {
       "type": "number"
      },
      "nauticalMiles": {
       "type": "number"
      },
      "timezoneOffsetDifferenceMinutes": {
       "type": "integer"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "km": 7936.2,
  "to": {
   "lat": -23.5475,
   "lon": -46.6361,
   "name": "São Paulo",
   "timezone": "America/Sao_Paulo"
  },
  "from": {
   "lat": 38.7167,
   "lon": -9.1333,
   "name": "Lisbon",
   "timezone": "Europe/Lisbon"
  },
  "miles": 4931.3,
  "compass": "SW",
  "bearingDeg": 224.1,
  "nauticalMiles": 4285.2,
  "timezoneOffsetDifferenceMinutes": -240
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-time-place-distance-calculator-9bbf12ed/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from time-place.agent-utils.workers.dev](https://www.zero.xyz/host/time-place.agent-utils.workers.dev/llms.txt)
