npm install
Replace YOUR_LICENSE_KEY
with your license key obtained from maxmind.com.
You can create maxmind account here.
cd node_modules/geoip-lite && npm run-script updatedb license_key=YOUR_LICENSE_KEY
node app.js
URL: localhost/api?ip=YOUR_REQUEST_IP_ADDRESS
For example :
http://127.0.0.1:3000/api?ip=207.97.227.239
Response success
{
"success": true,
"data": {
"range": [
3479298048,
3479306239
],
"country": "US",
"region": "FL",
"eu": "0",
"timezone": "America/New_York",
"city": "Orlando",
"ll": [
28.4647,
-81.2468
],
"metro": 534,
"area": 20
}
}
Response fail
{
"success": false,
"data": {}
}