# OnchainExpat x402 Geo Lookup API

> OnchainExpat x402 Geo Lookup API is a paid API for AI agents from x402.onchainexpat.com, paid per call via x402, $0.03/call, status unknown (last checked 2026-09-13).

Returns geolocation data for a given IP address or the requester's IP, paid per-request via x402 protocol

## Facts

- Endpoint: POST https://x402.onchainexpat.com/api/x402-proxy/fetch/geo
- Price: $0.03/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchainexpat-x402-geo-lookup-api-db9b52cc
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_BG6DNY1DmlqGBK4sj2VrW

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 onchainexpat-x402-geo-lookup-api-db9b52cc -d '<json body>'
```

Example prompt: Can you look up the geolocation for the IP address 8.8.8.8 and tell me its country, city, and approximate coordinates?

## When to prefer this

Choose this endpoint when you need pay-per-use IP geolocation without a subscription, especially in agentic or crypto-native workflows using the x402 payment protocol. Useful when you want lightweight, on-demand geo lookups billed in USDC.

## Known failure modes

- Invalid or malformed IP address returns an error
- Private/reserved IP addresses may return no useful location data
- Payment failure via x402 protocol blocks the request
- Empty response schema suggests limited documentation — actual fields may vary
- Rate limiting or quota exceeded may occur

## How this service works

Pay-per-request AI, crypto, proxy, and utility APIs using x402 protocol

## Output

A JSON object containing geolocation details for the queried IP address, likely including country, region, city, latitude, longitude, and ISP information.

## Example request

```json
{
 "url": "https://example.com",
 "country": "US"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "url",
  "country"
 ],
 "properties": {
  "url": {
   "type": "string",
   "description": "Target URL to fetch. Must start with http:// or https://"
  },
  "body": {
   "type": "string",
   "description": "Request body (string or JSON-stringified)"
  },
  "method": {
   "type": "string",
   "description": "HTTP method (default GET)"
  },
  "country": {
   "type": "string",
   "description": "Required 2-letter ISO country code (US, GB, DE, JP, BR, ...)"
  },
  "headers": {
   "type": "object",
   "description": "Custom request headers to forward"
  },
  "session_id": {
   "type": "string",
   "description": "1-8 alphanumeric chars to keep the same exit IP across requests"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "body": {
   "type": "string"
  },
  "country": {
   "type": "string"
  },
  "headers": {
   "type": "object"
  },
  "status_code": {
   "type": "integer"
  },
  "response_size_bytes": {
   "type": "integer"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchainexpat-x402-geo-lookup-api-db9b52cc/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.onchainexpat.com](https://www.zero.xyz/host/x402.onchainexpat.com/llms.txt)
