Country

Country is a browser-friendly and privacy-conscious geolocation API that gets your users' country (and nothing else) from their IP.

Usage

Country has a minimal :fire: interface.

Query the IP of the requesting client.

GET https://api.country.is/ HTTP/1.1

Query any IP.

GET https://api.country.is/9.9.9.9 HTTP/1.1

See the age of the underlying data file.

GET https://api.country.is/version HTTP/1.1

Country automatically checks for a newer version every 24 hours.

Deployment

If you prefer not to use the hosted service, run a private instance with Docker.

docker run -d -p 3000:3000 hakanensari/country -e LICENSE_KEY=YOUR_LICENSE_KEY

Replace the YOUR_LICENSE_KEY placeholder with a license key associated with your MaxMind account.

Notes

Country uses GeoLite2 data created by MaxMind. Since 30 December 2019, you need to register for a license key to download their data.

The hosted service does not log requests.