This is Google's cache of http://geoinfo.mohanjith.net/trac/wiki/Documetation/API. It is a snapshot of the page as it appeared on 29 May 2009 09:47:14 GMT.

Geo Info API

JSON API

API calls should be made to http://geoinfo.mohanjith.net/api2/. JSON API is discussed in detail in JSON.

Parameters

Following parameters can be passed with the request

  1. callback
  2. a
  3. ip
  4. argument

Response

All responses for JSON request will be of content type text/x-json, if you just try to visit a api request URI you will be asked to download a file, but if you load the URI as a javascript file if will work as expected.

e.g. http://geoinfo.mohanjith.net/api2/?ip=64.79.199.167

   {"_items":{"LocId":1503,"CityName":"Bellevue","Region":"WA","Country":{"_items":{"CountryName":"United States","CountryCode":"US"}}}}
   // This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com/.

HTML widget

For easy integration with your web site MOHA Geo Info web service has a HTML widget. You just have to add the following code block to your site. It is similar to adding Google Ad Sense.

For pages accessed via http

   <div id="moha.html.widget">
      <script src="http://geoinfo.mohanjith.net/api/scripts/geoinfo.js" type="text/javascript"></script>
      <script id="RSIFrame" type="text/javascript"></script>
      <span id="locationPanel" class="moha location"></span>
      <span class="geo courtecy">Courtesy  <a href="http://geoinfo.mohanjith.net">MOHA Geo</a>.</span>
      <script type="text/javascript">
         MOHA.GeoInfo.Location_Country.request('locationPanel');
      </script>
   </div>

For pages accessed via https

   <div id="moha.html.widget">
      <script src="https://mohanjith.net/geoinfo/api/scripts/geoinfo.js" type="text/javascript"></script>
      <script id="RSIFrame" type="text/javascript"></script>
      <span id="locationPanel" class="moha location"></span>
      <span class="geo courtecy">Courtesy  <a href="http://geoinfo.mohanjith.net">MOHA Geo</a>.</span>
      <script type="text/javascript">
         MOHA.GeoInfo.Location_Country.request('locationPanel');
      </script>
   </div>