Strict Standards: Declaration of action_plugin_googleanalytics::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /home/sxtxixtxcxh/docs.prototypeapps.com/lib/plugins/googleanalytics/action.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at /home/sxtxixtxcxh/docs.prototypeapps.com/lib/plugins/googleanalytics/action.php:6) in /home/sxtxixtxcxh/docs.prototypeapps.com/inc/auth.php on line 313

Warning: Cannot modify header information - headers already sent by (output started at /home/sxtxixtxcxh/docs.prototypeapps.com/lib/plugins/googleanalytics/action.php:6) in /home/sxtxixtxcxh/docs.prototypeapps.com/inc/actions.php on line 163
geoip:api - Documentation for Prototype Apps

GeoIP API

The API is *very* much in alpha, so let me know if you have any problems or requests.

JSON

Data will return in JSON by default.

If you pass a “callback” param, the data will be passed to a function using the callback value for the function name.

Using cURL

You can easily use cURL in the command line to test out responses.

Example:

curl http://geoip.prototypeapp.com/api/locate

API Methods

Many of these methods will return a HTTP 204 No Content on failure.

Locate Method

geoip.prototypeapp.com/api/locate

This method returns JSON (by default) or XML using the format parameter.

If you don't pass it an IP address, it will try to use the referrer's address.

Parameter Type
ip string - an IP address
format either 'xml' or 'json' - defaults to 'json'

The response should look like:

{
    "ip":"69.163.181.149",
    "timestamp":1263028293112,
    "location": {
        "coords": {
            "latitude":"33.9269",
            "longitude":"-117.861" 
        },
        "address": {
            "city":"Brea",
            "country":"United States",
            "country_code":"US"
        },
        "gmtOffset":"-8",
        "dstOffset":"-7"
    }
}

Personal Tools