Article

API: data in JSON- and JSONP format

There was the possibility to insert JavaScript (which contained an object with different parameters based on user's IP address) into projects. Now you can get these data in JSON- and JSONP format.

Data returned from API, based on the client's IP address:

  • latitude - the latitude of the country
  • longitude - the length of the country
  • zoom — the degree of approximation for maps based on Google Maps
  • address.city — the city (not available now)
  • address.country — the country
  • address.country_code — the country code according to ISO 3166-1
  • address.region — the region (not available now)

JSON

The query format:
http://api.wipmania.com/json
The answer looks like:
{"latitude":"51.0993","longitude":"10.4537","zoom":5,"address":{"city":"-","country":"Germany","country_code":"DE","region":"-"}}

JSONP

The query format:
http://api.wipmania.com/jsonp?callback=YourFunctionHere

YourFunctionHere - your name for the function

The answer looks like:

YourFunctionHere({"latitude":"51.0993","longitude":"10.4537","zoom":5,"address":{"city":"-","country":"Germany","country_code":"DE","region":"-"}})
Example of use with JQuery:
$.getJSON("http://api.wipmania.com/jsonp?callback=?",
 function(data) {
   alert(data.address.country);
});
As for the JavaScript version, there are no restrictions on the number of queries.
tags: ,
Christian Harms Germany15 Jun 2009 17:06#1098Deutsch   
wipmania logo Alrond 25 Jun 2009 13:06#1146Deutsch   
Carsten Germany29 Sep 2009 01:09#1679Deutsch   
Anonymous Germany30 Oct 2009 06:10#1755Deutsch   
wipmania logo Alrond 01 Nov 2009 20:11#1766Deutsch   

Anonymous/Name OpenID OpenID Yahoo! OpenID AOL WordPress LiveJournal TypePad Vox Myvidoop Orange Yandex YandexBlog Mixi Myspace Flickr Verisign MyOpenID ClaimID

All fields are not required

Leave blank for main post.
Comment - 5000 characters maximum. BBcode is allowed.

Subscribe to answers: to all comments:RSS comments (en)

Please have a look at our
Facebook Page and leave a comment

Creative Commons License
Creative Commons Attribution-Noncommercial 3.0 License