# x402 Data API – IP Geolocation

> x402 Data API – IP Geolocation is a paid API for AI agents from x402-data-api.onrender.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14, last successful call 2026-07-16).

Resolves an IPv4 or IPv6 address to its country, region, city, coordinates, and timezone via fast in-memory lookup.

## Facts

- Endpoint: GET https://x402-data-api.onrender.com/api/geo
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Last successful call: 2026-07-16
- Success rate: 100% of calls made through Zero
- Activations on Zero: 2
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-data-api-ip-geolocation-db5f5741
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_1NTqTMBgaxVEOP179o1pr

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 x402-data-api-ip-geolocation-db5f5741
```

Example prompt: What country, city, and timezone is the IP address 203.0.113.42 located in?

## When to prefer this

Choose this endpoint when you need lightweight, low-latency IP-to-location resolution for a single address, especially in analytics pipelines, fraud scoring, or personalization flows where country, region, city, and timezone are sufficient. Prefer it over heavyweight geolocation databases when you want a pay-per-call model at $0.001 USDC with no subscription overhead.

## Known failure modes

- Invalid or malformed IP address returns an error or empty result
- Private/reserved IP ranges (e.g. 192.168.x.x, 10.x.x.x) may return no meaningful geolocation
- Payment failure (402) if USDC balance is insufficient or x402 auth is missing
- Service cold-start latency on Render free tier may cause occasional timeouts
- IPv6 addresses may have lower geolocation accuracy than IPv4

## How this service works

IP geolocation: country, region, city, coordinates, and timezone for any IPv4 or IPv6 address. Fast in-memory lookup for analytics, fraud, and personalization agents.

## Output

Returns a JSON object containing the queried IP address, city name, region, country code, latitude/longitude pair (ll array), and timezone string — all derived from fast in-memory geolocation data.

## 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",
     "properties": {
      "ip": {
       "type": "string",
       "description": "IPv4 or IPv6 address to locate. Omit to geolocate the caller."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "ip": {
       "type": "string"
      },
      "ll": {
       "type": "array"
      },
      "city": {
       "type": "string"
      },
      "region": {
       "type": "string"
      },
      "country": {
       "type": "string"
      },
      "timezone": {
       "type": "string"
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-data-api-ip-geolocation-db5f5741/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-data-api.onrender.com](https://www.zero.xyz/host/x402-data-api.onrender.com/llms.txt)
