IP Address Geolocation Javascript API : JSON

For one of my project I needed IP geolocation database. While surfing I came to realize that there is a very good database available at iplocationtools.com. This website also provides XML API for this. This API can be accessed found at : IP Location API. However, for this particular project a needed some javascript API. My bad luck I couldn't find one. So, I myself made that API (using iplocation database), Hope it will help you as well.

Update

The original source is also providing the same service in JSON. So I am shutting down my API and would request you to use the API provided by the IPLocationTools.com

IPlocationTools.com is now IP2Location.com, and they doesn't provide APIs anymore. As the API provided by me were based on the IPLocationTools.com hence we have also stopped those APIs.

You can see http://www.ip2location.com/developers.aspx to see what are available options.

Moreover you can also see the free stable options available by Google at:

Sorry Guys

0saves
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Other Posts which you may like:

42 responses to “IP Address Geolocation Javascript API : JSON”

  1. Parashuram

    Should have used YAHOO pipes for the conversion … would have taken the stress off ur server…

  2. Parashuram
    1. jQuery Howto

      I just analysed your pipe and it seems it is taking data from iplocationtools.com, which is great. But somehow it is not returning my ip location :( where as Nitin’s server does. Well, I don’t know what might be a problem here :(

      PS. For jQuery adicts, here is jQuery geolocation script.

      Twitter @jqueryHowto

    2. Willington Vega

      Very usefull post.

      I just checked Parashuman’s pipe and it is correctly retrieving the data from iplocationtools.com however, since the returned XML has no title nor description attributes Yahoo Pipes is unable to show the results. I have cloned the pipe and made the necesary changes. Here is the pipe.

      http://pipes.yahoo.com/pipes/pipe.info?_id=20bb460bba7290ff75bf05cb30840697

      1. Willington Vega

        I’m sorry, I should have written Parashuram instead of Parashuman.

  3. Tim

    If you’re going to use Google Maps. Why don’t you use the built in IP geolocation that comes with Google’s API?

  4. Gesen

    Wow, this is really nice! Very easy to use.

  5. Eric

    Good job!
    JSON requires object keys and string values to be enclosed in double quotes, intead of single quotes. As far as Javascript is concerned, the result is still a valid object, by it can break other clients using strict JSON parsers.

  6. Hao Chen

    That’s pretty cool. Just wondering, why didn’t you use AJAX (JSON w/ callback) with a library like jQuery?

    1. jQuery Howto

      Here is a code and tutorial on how to use geolocation service with jQuery.

      Hope others also will find it useful.

      @jqueryHowto

  7. Marc

    Will add this soon on iplocationtools.com.

    Thanks
    Marc

  8. Geolocalización por IP mediante Javascript y JSON | dominios, diseño web, ecommerce - Mantis Technology Solutions Blog

    [...] IP Address Geolocation Javascript API : JSON [...]

  9. Enlaces de la semana (I) | Mareos de un geek

    [...] Geolocalización de IP’s con JSON y Javascript. [...]

  10. Martin Gonzalez

    Very useful, thanks mate!

  11. Определете Местоположението си с IP Address Geolocation API: JSON | Web 2.0 HotMonitor Blog

    [...] IP Address Geolocation API е много полезно API с чиято помощ може да откривате [...]

  12. jQuery Howto

    Great article and thanks for sharing this free service of yours. Inspired by your post here is an implementation of this geolocation identifiers service in jQuery.

    The article desicribes the service and shows how to work with in jQuery.

  13. nurettin

    wow very good idea ;)

  14. Yeah, but is it art? » links for 2009-04-17

    [...] IP Address Geolocation Javascript API : JSON | The Code Dreamer (tags: javascript ip api geolocation geocoding json Programming development maps location tools) [...]

  15. Salih GEDİK

    Nice work :)

  16. My Bad Attitude » IP Address Geolocation Javascript API : JSON

    [...] IP Address Geolocation Javascript API : JSON [...]

  17. IP Address Geolocation Javascript API : JSON | Nobox Media

    [...] IP Address Geolocation Javascript API : JSON Click here to go to this script [...]

  18. brian

    man.. this is really cool.
    this is what i’ve been looking for. thanks!

  19. fayvi

    Good work dude!

  20. kit

    very good idea

    wood pavilion

  21. vin

    I found a new site to check out IP Address details through
    http://www.ipaddressgeolocation.com

  22. Tom
  23. Motyar

    Not working for me.. :(

  24. hostingrehber

    very very good!

  25. Kiran

    Friends , Good that I found this blog. I am using geoplugin get my current location . Copy the following PHP code to server and acess it you will get the current location . But again this is not working in India . I tried for USA,India,Singapore and Australia .It worked for all countries except for India :( . Are yahoo pipes are working for India also to get the current location of the person . If So can any body please provide me a snippet of PHP code that gets me Country,State and City ( for India too) . Thanks for your help.

    Regards
    Kiran

  26. Kiran

    var_export(unserialize(file_get_contents(‘http://www.geoplugin.net/php.gp?ip='.$_SERVER'REMOTE_ADDR')));

  27. stephen

    This may help you:
    http://ipinfodb.com/ip_location_api.php
    They provide both xml and json apis

  28. Astematur

    very nice cod. Thanks.

  29. Kiran

    Thanks Stephen , That really helped me a lot

  30. fix it pro

    useful code… thanks

  31. red pepper

    Geolocalización de IP’s con JSON y Javascript

  32. red pepper

    Thanks for text. very good

  33. stas17

    Одни англичане.ICQ:414293541

  34. yasamphani

    Thanks for the feedback..!!

  35. Website Rank

    Thanks for the feedback..!!

  36. Samuel Lebeau

    I made a free service dedicated to this purpose: http://my-ip.cc/
    Its API provides a JSONP version so the actual geolocation of your visitors can be available to your JavaScript code without even a roundtrip to your server.
    Currently, it’s using http://hostip.info/ database for IP Geolocation, which is free and quite accurate as anyone can contribute to it, but it might be a good idea to integrate the ip2location service you’re mentionning too…

    Thanks for sharing this !

  37. Jack Andolini

    We are using http://www.IPAddressLabs.com and so far we are very happy. Very accurate, REALLY FAST, and so far (as far as we know) it is verey reliable. No failures, or at least we haven’t detected any in our logs.

Leave a Reply

Subscribe Me

Google Custom Search

Bookmarks