geoPlugin Home

XML Web Service

The XML web service1) allows you to directly program your back-end scripts to deliver dynamic geo-localized pages using the XML elements provided by geoPlugin.

To access this service, add the following url to a remote include call


http://www.geoplugin.net/xml.gp?ip=xx.xx.xx.xx


Of course, substitute the xx's with your visitor's IP number.

Example output of a XML query for your IP address (50.17.79.35) is:

<?xml version="1.0" encoding="UTF-8"?>
<geoPlugin>
	<geoplugin_request>50.17.79.35</geoplugin_request>
	<geoplugin_status>200</geoplugin_status>
	<geoplugin_credit>Some of the returned data includes GeoLite data created by MaxMind, available from <a href=\'http://www.maxmind.com\'>http://www.maxmind.com</a>.</geoplugin_credit>
	<geoplugin_city>Ashburn</geoplugin_city>
	<geoplugin_region>VA</geoplugin_region>
	<geoplugin_areaCode>703</geoplugin_areaCode>
	<geoplugin_dmaCode>511</geoplugin_dmaCode>
	<geoplugin_countryCode>US</geoplugin_countryCode>
	<geoplugin_countryName>United States</geoplugin_countryName>
	<geoplugin_continentCode>NA</geoplugin_continentCode>
	<geoplugin_latitude>39.043701</geoplugin_latitude>
	<geoplugin_longitude>-77.487503</geoplugin_longitude>
	<geoplugin_regionCode>VA</geoplugin_regionCode>
	<geoplugin_regionName>Virginia</geoplugin_regionName>
	<geoplugin_currencyCode>USD</geoplugin_currencyCode>
	<geoplugin_currencySymbol>&#36;</geoplugin_currencySymbol>
	<geoplugin_currencySymbol_UTF8>$</geoplugin_currencySymbol_UTF8>
	<geoplugin_currencyConverter>1</geoplugin_currencyConverter>
</geoPlugin>



XML Currency Converter

The “geoplugin_currencyConverter” element is the conversion rate for the currency converter base currency.
Like all calls to any of geoPlugin's web services, the default base_currency is USD ($US).
Thus, if your base currency is NOT $US, then you must add the variable base_currency=XXX to the call to geoplugin.net
eg

http://www.geoplugin.net/xml.gp?base_currency=EUR

Now the geoplugin_currencyConverter element will output the exchange rate of one Euro for your visitor.


The base_currency value must be a valid ISO 4217 3-letter code.





See also

1) This product includes GeoLite data created by MaxMind, available from http://maxmind.com/
 
 
Bookmark with:    Digg    StumbleUpon    Del.icio.us    Technorati


Acceptable Use Policy    Contact geoPlugin