geoip-lite / node-geoip

Native NodeJS implementation of MaxMind's GeoIP API -- works in node 0.6.3 and above, ask me about other versions
https://npmjs.org/package/geoip-lite
Other
2.32k stars 356 forks source link

Issue with country #209

Closed mhterres closed 3 years ago

mhterres commented 4 years ago

I started to notice a few days ago that the country returned cometimes is incorrect.

If I check the IP on the MaxMind GeoIP2 Demo website (https://www.maxmind.com/en/geoip-demo) it is correct, but the npm package returns a different country.

Example: Website 149.71.88.117 GB

My code:

const geoip=require('geoip-lite') const geo = geoip.lookup('149.71.88.117') console.log(geo.country)

node test.js HR

Is there some kind of issues with the DB being used by the package?

bluesmoon commented 4 years ago

Have you updated your DB recently? MaxMind releases a new database every month, and their website uses the commercial version of the database. If your database is older than a month, or if it is the free version, then it may not have the same results as their website.