API
| If you want to use the outcoming results of our service for own purposes, you can use our XML interface. |
||
| /xml.php | Check the IP Address of your own call | |
| /xml.php?ip_address=X&lang=Y | Check the IP Address X and get results in Y ( 1 = English | 2 = German | 3 = Spanish ) | |
You can also use our selfmade PHP script to generate queries. Click on the following link to download: Infosniper XMLQueryScript ( Released 2010-03-23 ) Or you use the Drupal Geosniper Module which can be found here: Visit Drupal Modules Download Site Result Example in XML:
<?xml version="1.0" encoding="UTF-8"?>
<results>
<result>
<ipaddress>80.137.230.29</ipaddress>
<hostname>p5089e61d.dip.t-dialin.net</hostname>
<provider>Deutsche Telekom Germany</provider>
<country>Germany</country>
<countrycode>de</countrycode>
<countryflag>http://www.infosniper.net/country_flags/de.gif</countryflag>
<state>Nordrhein-Westfalen</state>
<city>Aachen</city>
<areacode>n/a</areacode>
<postalcode>n/a</postalcode>
<dmacode>n/a</dmacode>
<timezone>Europe/Berlin</timezone>
<gmtoffset>1</gmtoffset>
<continent>Europe</continent>
<latitude>50.7708</latitude>
<longitude>6.1053</longitude>
<queries>37</queries>
</result>
</results>
Example in PHP to retrieve the geo data of an ip address:
<?php
$xmlstring = file_get_contents ( "http://www.infosniper.net/xml.php?ip_address=".$_SERVER["REMOTE_ADDR"] );
$xml = new SimpleXMLElement ( $xmlstring );
echo $xml->result[0]->ipaddress;
echo $xml->result[0]->hostname;
echo $xml->result[0]->provider;
echo $xml->result[0]->country;
echo $xml->result[0]->countrycode;
echo $xml->result[0]->countryflag;
echo $xml->result[0]->state;
echo $xml->result[0]->city;
echo $xml->result[0]->areacode;
echo $xml->result[0]->postalcode;
echo $xml->result[0]->dmacode;
echo $xml->result[0]->timezone;
echo $xml->result[0]->gmtoffset;
echo $xml->result[0]->continent;
echo $xml->result[0]->latitude;
echo $xml->result[0]->longitude;
echo $xml->result[0]->queries;
?>
|
||