XML Web Service
The XML web service 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 (38.107.191.91) is:
<?xml version="1.0" encoding="UTF-8"?> <geoPlugin> <geoplugin_city></geoplugin_city> <geoplugin_region></geoplugin_region> <geoplugin_areaCode>0</geoplugin_areaCode> <geoplugin_dmaCode>0</geoplugin_dmaCode> <geoplugin_countryCode>US</geoplugin_countryCode> <geoplugin_countryName>United States</geoplugin_countryName> <geoplugin_continentCode>NA</geoplugin_continentCode> <geoplugin_latitude>38</geoplugin_latitude> <geoplugin_longitude>-97</geoplugin_longitude> <geoplugin_regionCode></geoplugin_regionCode> <geoplugin_regionName/> <geoplugin_currencyCode>USD</geoplugin_currencyCode> <geoplugin_currencySymbol>$</geoplugin_currencySymbol> <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
- In-depth User Guide
-
- XML
-
-
