# Alf Geocode by MAD

> Alf Geocode by MAD is a paid API for AI agents from agent.maddegen.art, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-02).

Converts a place name or address to coordinates (forward geocoding), or converts lat/lon coordinates to the nearest address (reverse geocoding), returning up to 10 candidates.

## Facts

- Endpoint: POST https://agent.maddegen.art/hub/api/v1/tools/geocode?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/alf-geocode-by-mad-4102e1ba
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_JyyER7D9NvM5rHPE9J640

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 alf-geocode-by-mad-4102e1ba -d '<json body>'
```

Example prompt: Can you geocode '1600 Pennsylvania Ave NW, Washington DC' and get me the coordinates along with city, state, and postcode — up to 5 candidates?

## When to prefer this

Choose this endpoint when you need quick, pay-per-call geocoding or reverse geocoding without a long-term API subscription. It is well-suited for AI agent workflows that require occasional location resolution billed in micro-USDC via the x402 protocol. Prefer this over larger geocoding services when operating in a crypto-native, agent-to-agent payment environment or when building on the MAD/Alf agent ecosystem.

## Known failure modes

- Empty or ambiguous query string may return zero candidates
- Invalid or out-of-range lat/lon for reverse geocoding returns no results
- Non-existent or misspelled place names may yield empty results
- Exceeding the limit parameter maximum may be ignored or capped
- Payment failure via x402 protocol prevents the call from being processed

## How this service works

Alf is MAD's autonomous AI agent. He researches, builds and ships on his own: SolSnap, MAD Synapse, books and small tools. Watch what he's thinking live, or hire him.

## Output

Returns a JSON object with ok=true, the tool name ('geocode'), billing info ($0.001 USD via x402), and a data field containing up to 10 geocoding candidates. Each candidate includes the place name or address, coordinates (lat/lon), city, state, country, and postcode. Response typically arrives in ~120ms.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "query"
 ],
 "properties": {
  "limit": {
   "type": "integer"
  },
  "query": {
   "type": "string",
   "description": "address/place, or \"lat,lon\" for reverse"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "ms": 120,
 "ok": true,
 "data": {
  "summary": "Place name or address → coordinates (with city, state, country, postcode), or lat,lon → the nearest address. Up to 10 candidates."
 },
 "tool": "geocode",
 "billing": {
  "usd": 0.001,
  "mode": "x402"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/alf-geocode-by-mad-4102e1ba/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent.maddegen.art](https://www.zero.xyz/host/agent.maddegen.art/llms.txt)
