Giter Site home page Giter Site logo

geoip-rest's Introduction

##Introduction

GeoIP RESTful APIs are powered by Maxmind GeoIP City Database and provide Geo Location by IP address. The URL scheme is:

XML, JSON, Ruby and PHP are supported formats. See object notation for explanation. The API logic has 100% code coverage.

Country Service

Returns the originating country's name and code for the specified IP address.

Special keyword self returns location of caller's IP Address.

City Service

Returns the country, state/region, city, US postal code, US area code, metro code, latitude, and longitude information for the specified IP.

Special keyword self returns location of caller's IP Address.

Object Notation

See Object Notations Beyond Javascript for more details.

The GeoIP API provides XML, JSON, PHP and Ruby serialization format. Typically RESTful services are limited to JavaScript Object Notation (JSON). We are extending object notations to include PHP and Ruby languages now to better target PHP and Ruby applications. Targeting Object Notations for dynamic languages seems like a very good fit for REST style services. Sample outputs of various Object Notations are:

Object Notation

The GeoIP API provides XML, JSON, PHP and Ruby serialization format. Typically RESTful services are limited to JavaScript Object Notation (JSON). We are extending object notations to include PHP and Ruby languages now to better target PHP and Ruby applications. Targetting Object Notations for dynamic languages seems like a very good fit for REST style services. Sample outputs of various Object Notations are:

XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<city>
  <name>Daly City</name>
  <region-code>CA</region-code>
  <region-name>California</region-name>
  <country-code>US</country-code>
  <country-name>United States</country-name>
  <postal-code>94015</postal-code>
  <metro-code>807</metro-code>
  <metro-name>San Francisco-Oakland-San Jose</metro-name>
  <time-zone>America/Los_Angeles</time-zone>
  <area-code>650</area-code>
  <longitude>-122.476395</longitude>
  <latitude>37.678604</latitude>
</city>

JSON

{
  "name": "Daly City",
  "regionCode": "CA",
  "regionName": "California",
  "countryCode": "US",
  "countryName": "United States",
  "postalCode: 94015,
  "metroCode: 807,
  "metroName": "San Francisco-Oakland-San Jose",
  "timeZone": "America/Los_Angeles",
  "areaCode: 650,
  "longitude: -122.476395,
  "latitude: 37.678604"
}

Ruby Object Notation

{
  :name => "Daly City",
  :region_code => "CA",
  :region_name => "California",
  :country_code => "US",
  :country_name => "United States",
  :postal_code => "94015",
  :metro_code => 807,
  :metro_name => "San Francisco-Oakland-San Jose",
  :time_zone => "America/Los_Angeles",
  :area_code => 650,
  :longitude => -122.476395,
  :latitude => 37.678604
}

PHP Object Notation

array(
  "name" => "Daly City",
  "region_code" => "CA",
  "region_name" => "California",
  "country_code" => "US",
  "country_name" => "United States",
  "postal_code" => "94015",
  "metro_code" => 807,
  "metro_name" => "San Francisco-Oakland-San Jose",
  "time_zone" => "America/Los_Angeles",
  "area_code" => 650,
  "longitude" => -122.476395,
  "latitude" => 37.678604
)

Automatic Updates

Updates to GeoIPCity database are checked daily.

About Service

http://localhost/about

##License geoip-rest is licensed user GNU LESSER GENERAL PUBLIC LICENSE.

geoip-rest requires the usage of a local MaxMind database. Currently, their GeoLite databases may be used for free, provided that MaxMind is credited as the source of the data and the other terms of the Open Data License below are followed.

http://geolite.maxmind.com/download/geoip/database/LICENSE.txt

In order to waive the attribution requirement or, if you are planning on using one of the paid, GeoIP databases, please contact MaxMind at [email protected].

geoip-rest's People

Contributors

cpatni avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

geoip-rest's Issues

Thanks, Any Update ?

This code base seems quite useful to run in-house geoip service.
Would there be any update necessary as it seems for last couple of years there have been no change in code ?

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.