IP Geolocation API

IP Geolocation API

Get the location, city, country of an IPv4 or IPv6 address


The IP Geolocation API allows you to look up the location, country, city, timezone, and other details associated with an IPv4 or IPv6 address using a simple RESTful API.


  • Works with both IPv4 and IPv6: Ip address geolocation API supports looking up both IPv4 and IPv6 addresses.
  • Returns the country, region, city and timezone details: The API returns the country, region/state, city, latitude, longitude, area code, and whether the location is in the European Union (EU) or not.
  • Provides Timezone Information: Geolocation ip API returns the timezone name, current time in that timezone, whether the location observes Daylight Saving Time (DST), whether DST is currently in effect, the hemisphere, and the offset from UTC.
  • Includes Flag Information: The API returns the Unicode and emoji representation of the flag for the country associated with the IP address.

Getting Started

To access the IP Geolocation API , you need to obtain an API key from AnyAPI.io. The API key is used for authentication and should be included in the request URL as a query parameter.

Let’s Try Sign In.

Get the IP address location, timezone, etc. endpoint

Send a GET request to the following URL to Get the IP address location, timezone, etc.

curl --request GET \
  --url 'https://anyapi.io/api/v1/ip/lookup?ip='
  "ip": "",
  "location": {
    "country": "GB",
    "region": "ENG",
    "city": "Romford",
    "latitude": 51.5975,
    "longitude": 0.2299,
    "area": 200,
    "eu": false
  "timezone": {
    "name": "Europe/London",
    "currentTime": "10:53:31",
    "hasDST": true,
    "isDST": true,
    "hemisphere": "North",
    "offset": 1
  "flag": {
    "emoji": "🇬🇧",
    "unicode": "U+1F1EC"

Request parameters

Use the parameters listed below to customize your request. Mandatory parameters are indicated

IPv4 or IPv6 address
Your unique API key, which is required to authenticate your requests.

Response parameters

The API returns its response in a simple, lightweight JSON format.

The IP address that was looked up.
The country where the IP address is located.
The region/state within the country.
The city where the IP address is located.
The latitude coordinate of the location.
The longitude coordinate of the location.
The area code of the location (for US addresses).
A boolean indicating whether the location is within the European Union.
The name of the timezone the location is in.
The current time in that timezone.
Whether the location observes daylight saving time.
Whether daylight saving time is currently in effect.
The hemisphere the location is in (North or South).
The offset in hours from UTC for this timezone.
The Unicode emoji flag for the country.
The Unicode code point for the country's flag.

Response and error codes

Whenever you make a request that fails for some reason, an error is returned also in the JSON format. The errors include an error code and description, which you can find in detail below.

Status CodeTypeDetails
200OKThe request was successful.
400Bad RequestThe request was invalid or cannot be otherwise served.
401UnauthorizedAuthentication credentials were missing or incorrect.
422Quota reachedThe request cannot be served due to the application's rate limit having been exhausted for the resource.
404Not FoundThe requested resource could not be found.
429Too Many RequestsThe request cannot be served due to the application's rate limit having been exhausted for the resource.
500Internal Server ErrorSomething went wrong on the server.
503Service UnavailableThe service is temporarily unavailable.