# AgentPay Geocode — Forward & Reverse Geocoding via x402

> AgentPay Geocode — Forward & Reverse Geocoding via x402 is a paid API for AI agents from agentpay.help, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Converts a place name or address to geographic coordinates (forward geocoding) or converts lat/lon coordinates to a place name (reverse geocoding), paid per-call in USDC with no API key required.

## Facts

- Endpoint: POST https://agentpay.help/v1/geocode
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agentpay-geocode-forward-reverse-geocoding-via-x402-92762050
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_uLIC-QDAisT7AhMkiiqDu

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 agentpay-geocode-forward-reverse-geocoding-via-x402-92762050 -d '<json body>'
```

Example prompt: What are the latitude and longitude coordinates for Dubai, and what timezone is it in?

## When to prefer this

Choose this endpoint when you need a no-account, pay-per-call geocoding solution that supports both forward (place name to coordinates) and reverse (coordinates to place name) lookup in a single endpoint, especially in agent workflows where avoiding API key management matters and usage is infrequent or unpredictable. Prefer alternatives like Google Maps Geocoding or Nominatim if you need high-volume batch geocoding, street-level address precision, or structured address component parsing.

## Known failure modes

- Query string is empty or missing — returns validation error
- Place name is ambiguous or misspelled — may return zero results or incorrect match
- Coordinates provided in wrong format for reverse geocoding — parsing failure
- Payment not sent or USDC balance insufficient — 402 Payment Required response, call not processed
- Network timeout or service unavailability — no response or 5xx error

## How this service works

Pay-per-call AI services via the 402 Payment Required protocol. No accounts, no API keys — just USDC on Base.

## Output

A JSON object with the original query, a results array containing matched places each with latitude, longitude, place name, country name, country code, timezone string, and population, plus the count of results and a reverse flag indicating the geocoding direction used.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "query": {
   "type": "string",
   "minLength": 1,
   "description": "Place name, or 'lat,lon' for reverse lookup"
  },
  "reverse": {
   "type": "boolean",
   "description": "Force reverse mode, optional"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "count": 1,
  "query": "Dubai",
  "results": [
   {
    "lat": 25.07725,
    "lon": 55.30927,
    "name": "Dubai",
    "country": "United Arab Emirates",
    "timezone": "Asia/Dubai",
    "population": 3790000,
    "country_code": "AE"
   }
  ],
  "reverse": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agentpay-geocode-forward-reverse-geocoding-via-x402-92762050/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agentpay.help](https://www.zero.xyz/host/agentpay.help/llms.txt)
