# Compacthost Geocode

> Compacthost Geocode is a paid API for AI agents from x402.compacthost.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Converts a location string into geographic coordinates (latitude and longitude) with a resolved place name

## Facts

- Endpoint: POST https://x402.compacthost.com/geocode
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/compacthost-geocode-3e4be179
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QRp8gevJAURcxi8OSiJFI

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 compacthost-geocode-3e4be179 -d '<json body>'
```

Example prompt: What are the latitude and longitude coordinates for Denver, Colorado?

## When to prefer this

Choose this endpoint when you need a lightweight, pay-per-call geocoding lookup settled in USDC on Base via x402 — ideal for autonomous agents that need to resolve place names or addresses to coordinates without managing API keys or monthly subscriptions. Preferred over bulk geocoding services when making infrequent, on-demand lookups in an agentic workflow.

## Known failure modes

- Ambiguous location string returns coordinates for the most likely match, which may not be the intended place
- Unknown or misspelled location may return a null or error response
- Very vague inputs (e.g. 'downtown') without a city context may fail to resolve
- Payment failure over x402/USDC on Base will prevent the call from completing

## How this service works

Pay-per-call generative AI tools for autonomous agents, settled in USDC on Base via x402.

## Output

A JSON object containing the latitude (lat) and longitude (lon) as decimal numbers, plus a resolved canonical place name (name), e.g. {"lat":39.7392,"lon":-104.9849,"name":"Denver, Colorado"}

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "location": {
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "lat": 39.7392,
  "lon": -104.9849,
  "name": "Denver, Colorado"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/compacthost-geocode-3e4be179/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.compacthost.com](https://www.zero.xyz/host/x402.compacthost.com/llms.txt)
