# IP Geolocation Distance Calculator

> IP Geolocation Distance Calculator is a paid API for AI agents from ipgeo.payapi.market, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-17).

Given two IP addresses, geolocates each and returns the geographic distance between them in kilometers and miles.

## Facts

- Endpoint: POST https://ipgeo.payapi.market/lookup/distance?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ip-geolocation-distance-calculator-6eba4cbc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TuS90VNYoobpLajUGypA4

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-6eba4cbc -d '<json body>'
```

Example prompt: How far apart are 8.8.8.8 and 1.1.1.1 in the real world — can you geolocate both IPs and give me the distance in kilometers and miles?

## When to prefer this

Choose this endpoint when you need to compute the physical geographic distance between two specific IP addresses in a single API call, receiving both geolocation details and distance simultaneously. Prefer this over separate geolocation lookups when distance computation is the primary goal and you want to avoid multiple round-trips.

## Known failure modes

- Invalid IP address format for ip1 or ip2 returns an error
- Private or reserved IP ranges (e.g. 192.168.x.x, 10.x.x.x) may return no geolocation data
- Payment failure via x402 returns 402 Payment Required
- Missing required fields (ip1 or ip2) returns a validation error
- Geolocation database may have low accuracy for some ISPs or regions

## How this service works

IP geolocation, batch lookup, distance calculation, and caller-IP introspection with x402 payments.

## Output

Returns a JSON object with the geolocated details (IP, latitude, longitude, city, country) for each of the two input IPs, plus the calculated distance between them in both kilometers and miles.

## 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'."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ip1": {
   "ip": "8.8.8.8",
   "lat": 39.03,
   "lng": -77.5,
   "city": "Ashburn",
   "country": "United States"
  },
  "ip2": {
   "ip": "1.1.1.1",
   "lat": -33.87,
   "lng": 151.21,
   "city": "Sydney",
   "country": "Australia"
  },
  "distance_km": 15987.34,
  "distance_miles": 9934.12
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ip-geolocation-distance-calculator-6eba4cbc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ipgeo.payapi.market](https://www.zero.xyz/host/ipgeo.payapi.market/llms.txt)
