Reverse geocode

$0.001 per call · USDC via x402 · GET /api/reverse-geocode · Cached 1d

Resolve 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.

Category: Live public data · Tags: reverse-geocoding address lat-lon openstreetmap nominatim maps

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
latnumberyesLatitude, -90 to 90 Also accepted as latitude.
lonnumberyesLongitude, -180 to 180 Also accepted as lng, long, longitude.
zoomnumbernoDetail 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)"
}
FieldTypeAlways presentIn the example
latnumberyes38.8977
lonnumberyes-77.0365
displayNamestringyesWhite House, 1600, Pennsylvania Avenue Northwest, Washington, District of Col...
addressobjectyes7 fields: houseNumber, road, city, state, postcode, country
typestringyesattraction
classstringyestourism
osmstringyesway/238241022
sourcestringyesnominatim.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

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:

Related tools

Geocode address

$0.001 · GET /api/geocode

Resolve a free-form address or place name to coordinates: lat/lon, display name, bounding box, place type. OpenStreetMap…

Place search

$0.001 · GET /api/place-search

Search OpenStreetMap for places by keyword, optionally restricted to a bounding box or country. Returns ranked hits with…

A2A Agent Card validate

FREE w/ compute · or $0.002 · POST /api/a2a-card-validate

Validate an A2A (Agent2Agent protocol) Agent Card: required fields, skill shape, transport names, capability flags - spe…

Amortization schedule

FREE w/ compute · or $0.001 · POST /api/amortization

Build the full per-period amortization schedule for a fully-amortizing loan. Each row reports the period number, payment…

Annuity present/future value

FREE w/ compute · or $0.001 · POST /api/annuity

Present and future value of a level annuity (equal periodic payments). Supports an ordinary annuity (payments at period …

Barcode / QR decode

FREE w/ compute · or $0.001 · POST /api/barcode-decode

Decode a barcode or QR code from an image. Send a base64 PNG or JPEG (or a data: URL); returns the decoded text and the …