Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 1.48 KB

README.md

File metadata and controls

56 lines (42 loc) · 1.48 KB

Maxmind GeoipLite 2 Database API App and Docker container

Express app utilising Maxmind GeoLite2 database. The app updates the database file at 00:00 hrs on every Sunday.

How to run?

$ npm install
$ node index.js

How to resolve an IP address [API Endpoint]?

Send a query param of ?ip=A.B.C.D at the end of the hosted URL http://localhost:3000/?ip=A.B.C.D

What is the response that we get?

{
    "ip": "A.B.C.D",
    "continent": "Asia",
    "country_code": "IN",
    "country_name": "India",
    "time_zone": "Asia/Kolkata",
    "latitude": 17.3753,
    "longitude": 78.4744,
    "accuracy_radius": 10,
    "city": "Hyderabad",
    "region_name": "Telangana"
}

Is there a docker image for this?

You bet! You can use the image by executing (parameters of -p 3000:3000 will enable you to access the API from the URL http://localhost:3000/?ip=A.B.C.D). Read more at official Docker Repository

$ docker container run -d --name geoip-server -p 3000:3000 mib200/geoiplite2-maxmind

Features

  • Downloads the latest DB file automatically from Maxmind website.
  • Auto updates the database file every week.
  • Returns an absolute clean JSON response depending on how many fields are found in Maxmind DB response.

References

License

MIT