API for get GEO Locations (country, region, city, timezone, latitude/longitude) by IP address. Both IPv4 and IPv6 addresses are supported.
This API includes GeoLite data created by MaxMind, available from http://maxmind.com.
The project can be run by building the docker contained and then starting it
docker build -t identify-by-ip-2000 .
docker run --rm -d -p 8080:8080 identify-by-ip-2000
or without docker by command:
npm i && npm run start
For update database you should rebuild docker container or run:
npm run dbupdate
To run test use this command:
npm run test
Make a "GET" request:
- http://127.0.0.1:8080/v1/locations/?ip=35.156.49.254 - / for IPv4
- http://127.0.0.1:8080/v1/locations/?ip=2001:4860:4860::8888 - / for IPv6
Output message example:
{
"range": [
597438464,
597440511
],
"country": "DE",
"region": "HE",
"eu": "1",
"timezone": "Europe/Berlin",
"city": "Frankfurt am Main",
"ll": [
50.1155,
8.6842
],
"metro": 0,
"area": 200
}