IP geolocation: city, region, country and coordinates
No account. Pay by card from $1 and your key appears right after payment. Get a key by card
Geolocate an IPv4 or IPv6 address to its city, region, country (code and name), continent and approximate latitude and longitude, with the range the record covers, from DB-IP's City Lite data (CC BY 4.0, monthly; attributed in every answer). An HTTP call without ip answers for the caller's own address. City level at best; private addresses are refused. Use to localise a visitor or caller, or enrich logs; for the network owner use ip_lookup.
Inputs
| Name | Type | Description |
|---|---|---|
ip | string | Public IPv4 or IPv6 address (over HTTP, left out: the caller's own address) |
Request
Over HTTP, with a card key from /credits:
curl -H "Authorization: Bearer adt_…" "https://glyphtools.com/ip/geolocate?ip=8.8.8.8"
Node.js
const r = await fetch("https://glyphtools.com/ip/geolocate?ip=8.8.8.8", {
headers: { Authorization: "Bearer adt_…" },
});
const data = await r.json(); // 402 until the key is in the header
Python
import requests
r = requests.get("https://glyphtools.com/ip/geolocate?ip=8.8.8.8", headers={"Authorization": "Bearer adt_…"}, timeout=60)
data = r.json()
Or one of your 3 free calls, no key — the same request with &trial=1 on the end:
curl "https://glyphtools.com/ip/geolocate?ip=8.8.8.8&trial=1"
Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.
Example result
{
"ip": "8.8.8.8",
"version": 4,
"country": "US",
"countryName": "United States",
"region": "California",
"city": "Mountain View",
"latitude": 37.4056,
"longitude": -122.0775,
"continent": "NA",
"continentName": "North America",
"range": "8.8.8.0-8.8.8.255",
"accuracy": "city level at best; the free Lite data set, updated monthly",
"dataMonth": "2026-10",
"attribution": "IP Geolocation by DB-IP (https://db-ip.com), IP to City Lite, CC BY 4.0",
"attributionUrl": "https://db-ip.com"
}
From an AI agent (MCP)
Add the MCP server to Claude, Cursor or any MCP client. This tool is ip_geolocate, and the first 10 successful calls are free:
https://glyphtools.com/mcp