Geolocate an IP address
Returns the country for an IP address (IPv4 or IPv6), enriched with the full country record. Omit the IP (`GET /ip`) to geolocate the caller's own IP. A batch lookup of up to 100 IPs is available via `POST /ip` with a JSON array body. `GET /ip/info` returns metadata about the geolocation data source (provider, license, last updated).
Returns the country for an IP address (IPv4 or IPv6), enriched with the
full country record. Omit the IP (GET /ip) to geolocate the caller's
own IP. A batch lookup of up to 100 IPs is available via POST /ip with
a JSON array body. GET /ip/info returns metadata about the
geolocation data source (provider, license, last updated).
Path Parameters
IPv4 or IPv6 address.
Query Parameters
Comma-separated list of top-level fields to include, e.g. name,capital,flag.
Response Body
application/json
text/plain
curl -X GET "https://example.com/ip/8.8.8.8?fields=name%2Ccapital%2Cflag"{ "ip": "8.8.8.8", "countryCode": "US", "country": { "name": "Israel", "topLevelDomain": [ ".il" ], "alpha2Code": "IL", "alpha3Code": "ISR", "callingCodes": [ "972" ], "capital": "Jerusalem", "altSpellings": [ "string" ], "subregion": "Western Asia", "region": "Asia", "population": 9216900, "latlng": [ 31.5, 34.75 ], "demonym": "Israeli", "area": 20770, "timezones": [ "UTC+02:00" ], "borders": [ "EGY", "JOR", "LBN", "SYR" ], "nativeName": "ישראל", "numericCode": "376", "flags": { "svg": "http://example.com", "png": "http://example.com" }, "currencies": [ { "code": "ILS", "name": "Israeli new shekel", "symbol": "₪" } ], "languages": [ { "iso639_1": "he", "iso639_2": "heb", "name": "Hebrew", "nativeName": "עברית" } ], "flag": "🇮🇱", "maps": { "googleMaps": "http://example.com", "openStreetMaps": "http://example.com" }, "populationDensity": 443.6 }}"Country not found"Get a country by IOC code GET
Returns the country matching the given International Olympic Committee (IOC) country code.
Search cities GET
Search the world's cities (~34k populated places over 15k people, plus capitals, from GeoNames), ordered by population. Filter by name (`q`) and/or country. Also available: `GET /cities/{geonameId}` for one city, and `GET /cities/near?lat=&lng=` for the nearest cities to a coordinate.