📌  相关文章
📜  <a href="http: www.geoplugin.com geolocation " target="_new">IP Geolocation&lt;a&gt; by<a> <a href="http: www.geoplugin.com " target="_new">geoPlugin&lt;a&gt; <a>(1)

📅  最后修改于: 2023-12-03 14:59:07.250000             🧑  作者: Mango

IP Geolocation by geoPlugin

geoPlugin Logo

The IP Geolocation service provided by geoPlugin is a powerful tool for programmers to obtain geolocation information from an IP address. By making use of this service, you can extract valuable data about the location, country, region, city, latitude, longitude, and even the currency being used in a given IP address.

Usage

To access the IP Geolocation service, you can make a GET request to the following URL:

http://www.geoplugin.com/geolocation/<ip_address>.json

Replace <ip_address> with the IP address you want to geolocate.

Example

Let's take an example by geolocating the IP address 192.0.2.1.

Request
GET http://www.geoplugin.com/geolocation/192.0.2.1.json
Response
{
  "geoplugin_request": "192.0.2.1",
  "geoplugin_status": 200,
  "geoplugin_city": "Sample City",
  "geoplugin_region": "Sample Region",
  "geoplugin_areaCode": "123",
  "geoplugin_dmaCode": "456",
  "geoplugin_countryCode": "US",
  "geoplugin_countryName": "United States",
  "geoplugin_continentCode": "NA",
  "geoplugin_latitude": "37.751",
  "geoplugin_longitude": "-97.822",
  "geoplugin_currencyCode": "USD",
  "geoplugin_currencySymbol": "&#36;",
  "geoplugin_currencyConverter": 1
}
Response Parameters
  • geoplugin_request: The IP address being geolocated.
  • geoplugin_status: The status code indicating the success of the geolocation request.
  • geoplugin_city: The city where the IP address is located.
  • geoplugin_region: The region or state where the IP address is located.
  • geoplugin_areaCode: The area code associated with the IP address.
  • geoplugin_dmaCode: The DMA (Designated Market Area) code associated with the IP address.
  • geoplugin_countryCode: The country code of the IP address location.
  • geoplugin_countryName: The country name of the IP address location.
  • geoplugin_continentCode: The continent code where the IP address is located.
  • geoplugin_latitude: The latitude coordinate of the IP address location.
  • geoplugin_longitude: The longitude coordinate of the IP address location.
  • geoplugin_currencyCode: The currency code used in the IP address location.
  • geoplugin_currencySymbol: The symbol or HTML entity representing the currency symbol.
  • geoplugin_currencyConverter: The currency converter factor. (Usually set to 1 for the primary country currency)
Further Information

For more information, including additional endpoints and features offered by the geoPlugin service, please refer to the official geoPlugin website.

Note: This introduction is in Markdown format.