free IP geolocation webservice

 
 

It’s easy: you send an HTTP request to our service, and the service replies with all the information about an IP address in the format of your choice!


Currently supported formats are:


  1. CSV: http://freegeoip.appspot.com/csv/ip-address

  2. XML: http://freegeoip.appspot.com/xml/ip-address

  3. JSON: http://freegeoip.appspot.com/json/ip-address


After selecting the format, you put the IP address you’re looking for, like this:


http://freegeoip.appspot.com/xml/72.14.247.141


This will return all the information related to the IP address 72.14.247.141, or a failure code. The failure code will always respect the chosen data format.



Data formats


Text data is always encoded as UTF-8.


  1. CSV

The Comma Separated Values format will always return 10 columns in a single line, like this:


status,ip,countrycode,countryname, \

regioncode,regionname,city,zipcode, \

latitude,longitude


The data in the first two columns will always be present. Status can be either true or false, and must be used to determine the success or failure of the query.


  1. XML

The Extensible Markup Language format will always return the same document structure, with a Status node containing either true or false, used to determine the success or failure of a query.

Here is an example of the reply:


<?xml version="1.0" encoding="UTF-8"?>

<Response>

     <Status>true</Status>

     <Ip>x.x.x.x</Ip>

     <CountryCode>BR</CountryCode>

     <CountryName>Brazil</CountryName>

     <RegionCode>27</RegionCode>

     <RegionName>Sao Paulo</RegionName>

     <City>São Paulo</City>

     <ZipCode></ZipCode>

     <Latitude>-23.5333</Latitude>

     <Longitude>-46.6167</Longitude>

</Response>


  1. JSON

The JavaScript Object Notation is also available, and is the preferred method for retrieving the results.

The status key can be either true or false and is used to determine the success or failure of a query:


{"status":true,"ip":"x.x.x.x",

  "countrycode":"BR","countryname":"Brazil",

  "regioncode":"27","regionname":"Sao Paulo",

  "city":"São Paulo","zipcode":"",

  "latitude":-23.5333,"longitude":-46.6167}

 
  1. Country (code/name)

  2. Region (code/name)

  3. City

  4. Zip Code

  5. Latitude

  6. Longitude













































see also:


btbuckets

free web-segmentation tool that allows sites to create user clusters based on their behavior


fiorix.wordpress.com

my blog, featuring interesting tech articles and code snippets (portuguese and python)


ip geolocation sql database

this webservice is currently using Marc’s geolocation database.

How to use it