# OnchainExpat x402 Geocoding API

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

Converts a human-readable address or place name into geographic coordinates (latitude/longitude) via a pay-per-request x402 micropayment model

## Facts

- Endpoint: POST https://x402.onchainexpat.com/api/x402-tools/geocode
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onchainexpat-x402-geocoding-api-e41c6ec2
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8s_7DxY5NQOhy0_KGva-Y

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-geocoding-api-e41c6ec2 -d '<json body>'
```

Example prompt: Can you geocode '1600 Amphitheatre Parkway, Mountain View, CA' and give me the latitude and longitude?

## When to prefer this

Use this endpoint when you need pay-per-use geocoding without a subscription, especially in agentic or automated workflows that use the x402 micropayment protocol for on-demand billing at $0.01 USDC per call. Prefer over subscription-based geocoding APIs when request volume is unpredictable or low.

## Known failure modes

- Invalid or unrecognizable address returns an error or empty result
- Payment not included or insufficient USDC triggers x402 payment-required response
- Network timeout if upstream geocoding provider is slow
- Ambiguous place name may return incorrect or unexpected coordinates
- Rate limiting if too many requests are made in quick succession

## How this service works

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

## Output

Returns a JSON object containing the geographic coordinates (latitude and longitude) and possibly a formatted/normalized address for the input location string. Response schema is JSON but example payload is minimal.

## Example request

```json
{
 "address": "Eiffel Tower, Paris"
}
```

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "address"
 ],
 "properties": {
  "limit": {
   "type": "integer",
   "description": "Max results (default 5, max 10)"
  },
  "address": {
   "type": "string",
   "description": "Address or place name to geocode. Alias: 'query'. E.g. 'Eiffel Tower, Paris'"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "count": {
   "type": "integer"
  },
  "query": {
   "type": "string"
  },
  "cached": {
   "type": "boolean"
  },
  "results": {
   "type": "array"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onchainexpat-x402-geocoding-api-e41c6ec2/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)
