geoPlugin Home

Webservice Extras

The geoPlugin webservice extras build on the base webservices and are always being added to, based on your ideas and requests.
If you have any request for a webservice extras, please let us know and we'll do what we can to incorporate it.

Latitude/Longitude to Place

Not only can geoPlugin provide you with geolocation of IP addresses, but we can also reverse geocode any given latitude and longitude coordinates to a place.
This reverse geocoding allows you to specify the latitude and longitude coordinates and will output the nearest populated place in PHP, JSON, XML, or CSV formats.

To reverse geocode a latitude/longitude coordinate pair, simply call:

http://www.geoplugin.net/extras/location.gp?lat=XXX&long=YYY


replace XXX and YYY with the latitude and longitude values, respectively.

If no populated place is found within a 10-mile radius of your given coordinates, the server will return null



The default output is a PHP serialized array.
You can change the output by tagging on the format request variable as such:



For PHP:

http://www.geoplugin.net/extras/location.gp?lat=XXX&long=YYY&format=php

For JSON:

http://www.geoplugin.net/extras/location.gp?lat=XXX&long=YYY&format=json

For XML:

http://www.geoplugin.net/extras/location.gp?lat=XXX&long=YYY&format=xml



The location of 39.0481/-77.4728 (you) is:

	 Place: Ashburn
Country Code: US
Region: Virginia
Latitude: 39.0437200
Longitude: -77.4874900
Distance (miles): 0.84
Distance (km): 1.36


Nearby Places

Rather than give you the exact nearest populated place to a set of latitude/logitude coordinates, geoPlugin can reverse geocode an IP or latitude and longitude values to provide you with any number of populated places nearby.

As with the base webservices, with the exception of Javascript (use JSON for that), places nearby can be output in PHP, JSON, or XML to suite your needs.

To find places nearby a geographical location starting from an IP address, simply call:

http://www.geoplugin.net/extras/nearby.gp?ip=x.x.x.x


replace x.x.x.x with a valid IP address.

To find places nearby a geographical location starting from Latitude/Longitude values, simply call:

http://www.geoplugin.net/extras/nearby.gp?lat=XXX&long=YYY


replace XXX and YYY with the latitude and longitude values, respectively.

If no latitude or longitude values are set, then the lat/long values from PHP's $_SERVER['REMOTE_ADDR'] will be used, which may not be desirable



You can specify how many results to return by tagging on the limit variable eg

http://www.geoplugin.net/extras/nearby.gp?lat=XXX&long=YYY&limit=10

to return a maximum of 10 results


Additionally, you can specify the radius (in miles) of the search for nearby places, by tagging on the radius variable eg

http://www.geoplugin.net/extras/nearby.gp?lat=XXX&long=YYY&limit=10&radius=50

to return all nearby populated places within 50 miles of the given point.




The default output is a PHP serialized array.
You can change the output by tagging on the format request variable as such:



For PHP:

http://www.geoplugin.net/extras/nearby.gp?lat=XXX&long=YYY&format=php

For JSON:

http://www.geoplugin.net/extras/nearby.gp?lat=XXX&long=YYY&format=json

For XML:

http://www.geoplugin.net/extras/nearby.gp?lat=XXX&long=YYY&format=xml




For PHP users, the PHP Class has nearby places all built in.



Nearby places to you include:

1:
Place: Ashburn
Region: Virginia
Latitude: 39.0437200
Longitude: -77.4874900
Distance (miles): 0.84
Distance (km): 1.36
Direction (degrees) 142.9
Direction (heading) SE
2:
Place: Dulles Town Center
Region: Virginia
Latitude: 39.0376100
Longitude: -77.4158200
Distance (miles): 3.14
Distance (km): 5.06
Direction (degrees) 127.68
Direction (heading) SE
3:
Place: Sterling
Region: Virginia
Latitude: 39.0062200
Longitude: -77.4286000
Distance (miles): 3.74
Distance (km): 6.02
Direction (degrees) 164.53
Direction (heading) SSE
4:
Place: Herndon
Region: Virginia
Latitude: 38.9695500
Longitude: -77.3861000
Distance (miles): 7.15
Distance (km): 11.51
Direction (degrees) 161.68
Direction (heading) SSE
5:
Place: Poolesville
Region: Maryland
Latitude: 39.1459400
Longitude: -77.4169300
Distance (miles): 7.39
Distance (km): 11.9
Direction (degrees) 4.04
Direction (heading)




Latitude/Longitude to Postal Code

The reverse geocoding of a latitude/longitude coordinate pair to populated place given above uses a database of many millions of geospatial coordinates and is very well developed, especially for developed countries.

However, because of copyright and cost issues, we cannot provide postal codes (zip codes) for all of these places.

Nonetheless, we can provide reverse geocoding of latitude/longitude coordinate pairs to postal codes for about a million of these locations.

This post code web service can be accessed using:

http://www.geoplugin.net/extras/postalcode.gp?lat=XXX&long=YYY


To provide the nearest populated place with a post code within a 10-mile radius of your given coordinates.

Like always, the format= variable can be appended to specify PHP, JSON, or XML outputs.

The closest place with a post code we have on file for 39.0481/-77.4728 (you) is:

	 Place: Ashburn
Country Code: US
Post Code: 20147
Latitude: 39.0373001
Longitude: -77.4804993
Distance (miles): 0.85
Distance (km): 1.37
Confidence: 0


EU Cookie Law


If you or your organization are based in the European Union, or your website is intended for people located inside the European Union, and your website uses cookies, you are required by European law to inform your European visitors that your site uses cookies and require their consent before setting any cookies.

This is the so-called new “EU cookie law”.

If your visitor is outside the European Union, you are not required to ask for consent prior to setting cookies.

Use the CookieLaw geoPlugin Javascript extra to determine if your visitor is required to consent to setting cookies (ie the visitor comes from one of the 27 European countries).

The output from cookielaw.js is a Javascript function providing a Boolean true/false response allowing you to decide whether you need to ask permission from your visitor (true) or not (false) to set cookies.

<script src="http://www.geoplugin.net/extras/cookielaw.js" type="text/javascript"></script>


the output for you is:



GDPR


The General Data Protection Regulation (GDPR) (EU) is a regulation in EU law on data protection and privacy for all individuals within the European Union (EU) and the European Economic Area (EEA).


The GDPR contains provisions and requirements pertaining to the processing of personally identifiable information of individuals inside the European Union, and applies to all enterprises, regardless of location, that are doing business with the European Economic Area.

A processor of personal data must clearly disclose any data collection, declare the lawful basis and purpose for data processing, how long data is being retained, and if it is being shared with any third-parties or outside of the EU. This is outlined in our Privacy Policy and User agreement that you abide to by using any of geoPlugin's web services.



All main geoPlugin IP geolocation webservices identify whether the person is protected by GDPR by the variable geoplugin_inEU. If the value is 1, then you must apply the EU GDPR protection rule. If the value is 0, then the visitor is outside the EU and GDPR does not apply.

For example,
calling the Javascript IP geolocation webservice, the result for you is:



calling the JSON IP geolocation webservice, the result for you is:


calling the PHP IP geolocation webservice, the result for you is:


and so on for XML, ASP, and CSV webservices.

EU VAT Rate


European acts in the field of taxation have to be adopted by unanimity. The current provisions on VAT rates are thus the result of different compromises agreed by all the EU Ministers of Finance.

The VAT Directive sets the framework for the VAT rates in the EU, but it gives national governments freedom to set the number and level of rates they choose, but are to be applied as the standard rate for all goods and services.

If you are an EU business, doing business with an EU client, you must apply the VAT rate of the country your client resides in, not your country.

At geoPlugin, we help you determine what that rate is by specifying the General VAT rate (specified as a percentage) of your visitor's country

All main geoPlugin IP geolocation webservices identify whether the person is in the EU by the variable geoplugin_inEU.
If the value is 1, then the variable geoplugin_euVATrate tells you the %VAT that is required on any purchases for that person.

If the client is not in the EU, then the value of geoplugin_euVATrate is false.



For example,
calling the Javascript IP geolocation webservice, the result for you is:



calling the JSON IP geolocation webservice, the result for you is:


calling the PHP IP geolocation webservice, the result for you is:


and so on for XML, ASP, and CSV webservices.


See also

 
 


Acceptable Use Policy    Privacy Policy and User Agreement    Contact geoPlugin


©2006 - 2018 GEOPLUGIN, SAS