Code Monkey home page Code Monkey logo

geoip-dbip-rest-api's Introduction

IP Geolocation REST API

travis-ci

This project provides a simple web service which returns geolocation information for a given IP address.

Geolocation data is loaded from a db-ip.com geoip database file. The service requires the "full" database (IP address to location + ISP), which you need to purchase from db-ip. The database file is loaded from the file set in the environment variable DB_IP_FILE, /srv/dbip.csv.gz by default. You can use a volume mount to mount the database file into the running container.

To test the image, you can run it without a mount. The image includes a sample file with a single entry for the IPv4 address range 0.0.0.0/8.

Running the container

docker run -p 8080:8080 \
    -v /path/to/dbip-full.csv.gz:/srv/dbip.csv.gz \
    shopping24/geoip-api

Using the API

When the container is running, you can query it via simple HTTP GET requests:

curl http://localhost:8080/0.0.0.1
{
  "country": "ZZ",
  "latitude": "0",
  "longitude": "0",
  "isp": "Current network",
  "organization": "RFC 6890"
}

Building the project

Build the container image by calling:

mvn clean verify

Contributing

We're looking forward to your comments, issues and pull requests!

License

This project is licensed under the Apache License, Version 2.

geoip-dbip-rest-api's People

Contributors

joergrathlev avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.