The IP Geolocation API enables you to look up the location, country, city, timezone, etc of an IPv4 or IPv6 address with a simple RESTful API
IP Geolocation API supports one GET
endpoint. Send the following request to look up an IP address:
curl -X 'GET' 'https://anyapi.io/api/v1/ip/lookup?ip=66.249.86.22&apiKey=<YOUR_API_KEY>'
which returns this payload:
{ "ip": "66.249.86.22", "location": { "country": "US", "region": "OK", "city": "Pryor", "latitude": 36.2921, "longitude": -95.3129, "area": 1000, "eu": false }, "timezone": { "name": "America/Chicago", "currentTime": "04:02:55", "hasDST": true, "isDST": false, "hemisphere": "North", "offset": -6 }, "flag": { "emoji": "🇺🇸", "unicode": "U+1F1FA" } }
Or to look up an IPv6 address, send the following request:
curl -X 'GET' 'https://anyapi.io/api/v1/ip/lookup?ip=2607:f0d0:1002:51::4&apiKey=<YOUR_API_KEY>'
{ "ip": "2607:f0d0:1002:51::4", "location": { "country": "US", "region": "TX", "city": "Frisco", "latitude": 33.2559, "longitude": -96.8853, "area": 500, "eu": false }, "timezone": { "name": "America/Chicago", "currentTime": "04:07:49", "hasDST": true, "isDST": false, "hemisphere": "North", "offset": -6 }, "flag": { "emoji": "🇺🇸", "unicode": "U+1F1FA" } }
This API provides the following endpoints:
Check out the IP Geolocation API Docs for more details.