GithubHelp home page GithubHelp logo

gkarthiks / ip-geo-locator Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 2.0 231 KB

Returns the GEO location of the IP Address provided

Home Page: https://gkarthiks.github.io/ip-geo-locator/

License: MIT License

Go 87.81% Dockerfile 12.19%
golang charset ip geo-location

ip-geo-locator's Introduction

IP Geo Locator

Docker Cloud Automated build Docker Cloud Build Status Release language Go Report Card GitHub CodeQL

Live Demo

Try the live demo in Heroku here: https://ip-geo-locator.herokuapp.com/ip/218.189.35.128

Locates the geography of the given IP address. The webserver continiously runs on port 8080 and accepts the GET request on the following endpoint http://<server-address>:8080/ip/<comma_separated_IP_addresses>

Requests to the above endpoint will be responded with the user friendly JSON responses as shown below.

{
  "Responses": [
    {
      "ip": "218.189.35.128",
      "host": "218.189.35.128",
      "isp": "HGC",
      "city": "",
      "countrycode": "HK",
      "countryname": "Hong Kong",
      "latitude": "22.25",
      "longitude": "114.1667"
    }
  ]
}

As explained earlier, the server also accepts the comma separated IP address and will respond with array of JSON objects as shown below.

Comma separated multiple IP Addresses

http://localhost:8080/ip/218.189.35.128,118.189.35.128,18.189.35.128

JSON Response

{
  "Responses": [
    {
      "ip": "218.189.35.128",
      "host": "218.189.35.128",
      "isp": "HGC",
      "city": "",
      "countrycode": "HK",
      "countryname": "Hong Kong",
      "latitude": "22.25",
      "longitude": "114.1667"
    },
    {
      "ip": "118.189.35.128",
      "host": "118.189.35.128",
      "isp": "M1 Connect Pte Ltd",
      "city": "Singapore",
      "countrycode": "SG",
      "countryname": "Singapore",
      "latitude": "1.2929",
      "longitude": "103.8547"
    },
    {
      "ip": "18.189.35.128",
      "host": "18.189.35.128",
      "isp": "Amazon.com",
      "city": "Columbus",
      "countrycode": "US",
      "countryname": "United States",
      "latitude": "39.9653",
      "longitude": "-83.0235"
    }
  ]
}

Docker Image

This utility project is dockerized and is avilable as a docker image here.

ip-geo-locator's People

Contributors

gkarthiks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tayron

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.