Find a Location from an IP Address
Find out what you can do with our API...
API method to use: ip_locationDocumentation on the T2A API ip_location method which returns the country and the approximate city location of an IP address.
Trace an IP address to find the real-world geographical location of a computer or device, including a country and approximate city.
Every computer or device connected to the internet has an Internet Protocol Address (IP Address) which can be used to indentify it. We can trace this IP address to find the real-world geographical location of a computer or device, including a country and approximate city, as well as latitude and longitude information which can be used to plot the location on a map, for example.
There are many reasons you might wish to know where your visitors are geographically based; dynamically changing the language of your website, pre-selecting a visitor's country on your sign-up forms, and reducing credit card fraud based on geographic location are just a few examples.
|ip_address||Enter an IPV4 address in text form (e.g. 220.127.116.11) or the DNS name (e.g. simunix.com)|
|client||You can optionally include an identifier for your final client or user. This is logged in your usage log and you will be able to view your usage statistics by client.|
|callback||When using JSON, specify a JSONP wrapper in which the JSON response is to be wrapped.|
The XML response is contained within a
|error_code||Returns the error code when the status is
|t2a_version_number||The current API version number.|
|credit_used||The number of credits used in order to execute the request.|
|ip_address||The IP address submitted, in text form. If the submitted value was a DNS entry, this is the IP address of that entry.|
|hostname||DNS entry value.|
|geo_data||A geo_data record. Note that city is set in geo_data, where possible|
See the common error codes. There are no errors which are specific to this method.
Free Test Mode
When operating in the free test mode errors are returned if mandatory parameters are missing, or it returns a dummy data response, in an identical format to a real response.
Note that the
mode is returned as
test when the method is operating in the free test mode.
Example XML Response
<?xml version="1.0"?> <ip_location_res> <t2a_version_number>1.0.0</t2a_version_number> <status>ok</status> <ip_address>18.104.22.168</ip_address> <hostname>simunix.com</hostname> <geo_data> <north>214994</north> <east>382869</east> <country_code>GB</country_code> <country_name>United Kingdom</country_name> <latitude>51.8333</latitude> <longitude>-2.25</longitude> <city>Gloucester</city> </geo_data> </ip_location_res>