Geolocation from an IP address
GET
https://api.woosmap.com/geolocation/position
The /position returns JSON location of your users thanks to IP address of their devices.
Authorization
Query Parameters
ip_address
string
Response
Geolocation successfully retrieved
viewport
object
Show 2 propertiesHide 2 properties
accuracy
number
latitude
number
longitude
number
country_code
string | null
country_name
string
continent
string
region_state
string
city
string
postal_code
string
timezone
string
raw_offset
integer
dst_offset
integer
curl -L 'https://api.woosmap.com/geolocation/position?private_key=YOUR_PRIVATE_API_KEY&ip_address=173.79.254.254'
const requestOptions = {
method: "GET",
redirect: "follow"
};
fetch("https://api.woosmap.com/geolocation/position?private_key=YOUR_PRIVATE_API_KEY&ip_address=173.79.254.254", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
import requests
url = "https://api.woosmap.com/geolocation/position?private_key=YOUR_PRIVATE_API_KEY&ip_address=173.79.254.254"
payload = {}
headers = {}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
{
"country_code": "US",
"country_name": "United States",
"continent": "North America",
"latitude": 38.719,
"longitude": -77.1067,
"viewport": {
"northeast": {
"lat": 38.763915764205976,
"lng": -77.0491321464058
},
"southwest": {
"lat": 38.674084235794034,
"lng": -77.16426785359421
}
},
"accuracy": 5,
"city": "Alexandria",
"region_state": "Virginia",
"postal_code": "22309",
"timezone": "America/New_York",
"raw_offset": -18000,
"dst_offset": 3600
}
{
"detail": "Incorrect authentication credentials. Please check or use a valid API Key"
}
{
"detail": "This Woosmap API is not enabled for this project."
}
{
"detail": "The rate limit for this endpoint has been exceeded"
}