Reverse geocode
GET /api/reverse-geocode · Cached 1dResolve a lat/lon to a structured postal address: road, house number, city, state, postcode, country (with ISO code). Send GET /api/reverse-geocode with the required fields lat and lon and pay $0.001 per call over x402 or MPP (there is no free tier). It returns a JSON object with lat, lon, displayName, address, type and 3 more.
OpenStreetMap/Nominatim, no key. ?lat=38.8977&lon=-77.0365.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
lat | number | yes | Latitude, -90 to 90 Also accepted as latitude. |
lon | number | yes | Longitude, -180 to 180 Also accepted as lng, long, longitude. |
zoom | number | no | Detail level, 3 (country) to 18 (building). Default 18. |
Example request
curl -i "https://agent402.tools/api/reverse-geocode?lat=38.8977&lon=-77.0365"
Without payment this returns HTTP 402 Payment Required with the exact price for reverse-geocode; any x402 v2 or MPP client pays it and retries.
Example response
{
"lat": 38.8977,
"lon": -77.0365,
"displayName": "White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States",
"address": {
"houseNumber": "1600",
"road": "Pennsylvania Avenue Northwest",
"city": "Washington",
"state": "District of Columbia",
"postcode": "20500",
"country": "United States",
"countryCode": "us"
},
"type": "attraction",
"class": "tourism",
"osm": "way/238241022",
"source": "nominatim.openstreetmap.org (ODbL)"
}
| Field | Type | Always present | In the example |
|---|---|---|---|
lat | number | yes | 38.8977 |
lon | number | yes | -77.0365 |
displayName | string | yes | White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Col... |
address | object | yes | 7 fields: houseNumber, road, city, state, postcode, country |
type | string | yes | attraction |
class | string | yes | tourism |
osm | string | yes | way/238241022 |
source | string | yes | nominatim.openstreetmap.org (ODbL) |
From an MCP client
catalog.call {
"slug": "reverse-geocode",
"params": {
"lat": 38.8977,
"lon": -77.0365
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for reverse-geocode; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
latandlonare required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - Cached: an identical request within 1d is answered from cache with
X-Cache: hit. - A
POSTwith a JSON body to /api/reverse-geocode is served as this GET, with the body as the input. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/reverse-geocode?lat=38.8977&lon=-77.0365");
Part of these workflows
Reverse geocode is one step in this skill pack, each sold as a single call:
- Location intel - Point at an address (or even a rough place name) and assemble the situational brief: precise coordinates, the canonical postal address, what's within walking distance, the live weather forecast, active NWS hazard alerts, and recent seismic activity. The deterministic 'what should I know about this place right now?' workup.
Related tools
Geocode address
GET /api/geocodeResolve a free-form address or place name to coordinates: lat/lon, display name, bounding box, place type. OpenStreetMap…
Place search
GET /api/place-searchSearch OpenStreetMap for places by keyword, optionally restricted to a bounding box or country. Returns ranked hits with…
A2A Agent Card validate
POST /api/a2a-card-validateValidate an A2A (Agent2Agent protocol) Agent Card: required fields, skill shape, transport names, capability flags - spe…
Amortization schedule
POST /api/amortizationBuild the full per-period amortization schedule for a fully-amortizing loan. Each row reports the period number, payment…
Annuity present/future value
POST /api/annuityPresent and future value of a level annuity (equal periodic payments). Supports an ordinary annuity (payments at period …
Barcode / QR decode
POST /api/barcode-decodeDecode a barcode or QR code from an image. Send a base64 PNG or JPEG (or a data: URL); returns the decoded text and the …