geo_info_from_ip_address()
Learn how to use the geo_info_from_ip_address() function to retrieve geolocation information about IPv4 or IPv6 addresses.
Retrieves geolocation information about IPv4 or IPv6 addresses.
Syntax
geo_info_from_ip_address(IpAddress )
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| IpAddress | string | ✔️ | IPv4 or IPv6 address to retrieve geolocation information about. |
Returns
A dynamic object containing the information on IP address whereabouts (if the information is available). The object contains the following fields:
| Name | Type | Description |
|---|---|---|
country | string | Country name |
state | string | State (subdivision) name |
city | string | City name |
latitude | real | Latitude coordinate |
longitude | real | Longitude coordinate |
Examples
print ip_location=geo_info_from_ip_address('20.53.203.50')
Output
| ip_location |
|---|
{"country": "Australia", "state": "New South Wales", "city": "Sydney", "latitude": -33.8715, "longitude": 151.2006} |
print ip_location=geo_info_from_ip_address('2a03:2880:f12c:83:face:b00c::25de')
Output
| ip_location |
|---|
{"country": "United States", "state": "Florida", "city": "Boca Raton", "latitude": 26.3594, "longitude": -80.0771} |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.