# IP Geolocation Distance Calculator

> IP Geolocation Distance Calculator is a paid API for AI agents from ip-geo-api-production.up.railway.app, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Calculates great-circle distance (in km and miles) between two IP addresses, returning city, country, and lat/lng for each.

## Facts

- Endpoint: POST https://ip-geo-api-production.up.railway.app/lookup/distance
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ip-geolocation-distance-calculator-35a57a40
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XC7Ymm2nJJ13S3VLsL-cJ

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 ip-geolocation-distance-calculator-35a57a40 -d '<json body>'
```

Example prompt: What's the great-circle distance between IP 8.8.8.8 and 1.1.1.1, and which cities and countries are they located in?

## When to prefer this

Use this endpoint when you need both the geographic coordinates/city details AND the distance between two IPs in a single call, rather than making two separate single-IP lookups and computing distance yourself. Ideal for fraud detection, network analysis, CDN planning, or any scenario comparing the physical proximity of two network endpoints.

## Known failure modes

- Invalid or malformed IP address returns an error indicating which IP failed validation
- Private/reserved IP addresses (e.g. 192.168.x.x, 10.x.x.x) may not be geolocatable and return null or error
- Missing ip1 or ip2 field in request body returns a 400 bad request
- IPv6 addresses may have reduced geolocation accuracy
- Geolocation database may not have coverage for all IPs, returning partial or null location data

## How this service works

Great-circle distance (km and miles) between two IP addresses, with each endpoint's city/country/lat/lng.

## Output

Returns the great-circle distance in both kilometers and miles between the two IPs, along with each IP's resolved city, country, latitude, and longitude.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "ip1": {
   "type": "string",
   "description": "First IP address, e.g. '8.8.8.8'."
  },
  "ip2": {
   "type": "string",
   "description": "Second IP address, e.g. '1.1.1.1'."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ip-geolocation-distance-calculator-35a57a40/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ip-geo-api-production.up.railway.app](https://www.zero.xyz/host/ip-geo-api-production.up.railway.app/llms.txt)
