Reverse geocoding API (offline city data)

Updated 2026-10-12

Use when an agent must turn a city name into coordinates, or coordinates into the nearest city.

From an MCP client, add https://tanod.dev/mcp and call geocode; its free daily calls are applied automatically, no key or signup.

POST lat and lon to /v1/geocode to get the nearest city and its distance in kilometres. Send place instead for forward geocoding with up to 5 candidates. It uses an offline GeoNames table, with no street addresses.

Request

Give either lat with lon (reverse) or place such as "Berlin, DE" (forward), not both.

curl, using the free tier
curl -s -X POST https://tanod.dev/v1/geocode \
  -H 'X-Tanod-Free: 1' -H 'content-type: application/json' \
  -d '{"lat":52.52,"lon":13.405}'

Response

Response (trimmed)
{
  "mode": "reverse",
  "query": {"lat": 52.52, "lon": 13.405},
  "results": [{
    "name": "Mitte",
    "country_code": "DE",
    "admin1_code": "16",
    "lat": 52.52003,
    "lon": 13.40489,
    "population": 102338,
    "timezone": "Europe/Berlin",
    "distance_km": 0.01
  }],
  "attribution": {
    "places": "GeoNames (geonames.org), CC BY 4.0",
    "license": "https://creativecommons.org/licenses/by/4.0/"
  }
}

Limits and caveats

City level only. The data is the GeoNames cities15000 table: cities of 15,000 or more people. The result is the nearest such city, which can be some distance away; check distance_km. There are no street addresses.

Attribution. Place data is from GeoNames (geonames.org), licensed CC BY 4.0, reduced to selected columns. Credit GeoNames when you show or republish it.

No match for a forward query is a 404 place_not_found and is not charged.

Price and free allowance

USD 0.001 per call, paid in USDC on Base, Polygon, Solana, BNB Chain or Arbitrum with x402. 10 free calls per IP per UTC day with the header X-Tanod-Free: 1. The pool is shared with FX rates, QR and holidays. MCP tool: geocode at https://tanod.dev/mcp, where the free tier is automatic.

All endpoints →

Use it from Claude without writing code: in claude.ai or Claude Desktop, add https://tanod.dev/mcp/util?via=reverse-geocoding-api as a custom connector (steps), then ask in plain words, for example "What city is at latitude 48.8566 and longitude 2.3522?" The free daily allowance is applied automatically over MCP. Beyond it a call needs an x402 payment, which these clients can make.

Related guides: What geocoding APIs cost over x402, Weather forecast API without an API key, Public holidays API, How to generate a QR code via API. Back to tanod.dev or the guide index. Results are automated and heuristic.