We are proud to announce that from today, at the user demand, the JSON version of the IPGP Geolocation API is now available. Since today, the data was only available trough XML. Application Developers can now have the IP geolocation data returned in a format which is more friendly with all programming languages.
JSON stands for JavaScript Object Notation. It is derived from JavaScript data structures, and is design to make the data readable by humans. The size of the data sent trough JSON is smaller than the size required to send data trough XML.
Here is an example of IP Location data returned in JSON:
{ "Details": { "ip":"74.29.-.-", "code":"US", "country":"United States", "flag":"http:\/\/www.ipgp.net\/flags\/us.png", "city":"San Francisco", "region":"CA", "isp":"Comcast Cable", "organization":"Comcast Cable", "lat":38, "long":-97 } }
Most programming languages have built-in functions to work with JSON data, including: Javascript, PHP, Java, ASP, C++, C#, Visual Basic, etc. For a complete list of programming languages and libraries to work with JSON data, please consult the official JSON site.
For example, in JavaScript, the right way to parse a JSON string is:
var myObject = JSON.parse(myJSONtext, reviver);
More information about working with JSON in javascritp here: http://www.json.org/js.html
In PHP, the right way to work with JSON data is: json_decode(myJSONtext);
To get access to IPGP Geolocation and to get your API key you have to set up your subscription here: IPGP Geolocation API.