Location of a specific IP
The geolocation endpoint returns the complete location information for an IP address specified in the URL. This type of request is typically used on the server side, where the server knows the IP address of a user and wants to retrieve its location.
Heads up!
You need an API key to use this endpoint. Obtain your API key from the API Keys page and set it in the
X-API-Key
header of your requests.HTTP Request
https://api.ipflare.io/{ip}
URL Parameters
Parameter | Description |
---|---|
ip | An IP address for which you want to retrieve the location. If no IP address is provided, we will use the requester's IP address, but we advise providing the IP address for more reliable results. |
Headers
Header | Description |
---|---|
X-API-Key | The API key required to authenticate requests. You can obtain your API key from the API Keys page. |
Response Fields
Field | Description |
---|---|
ip | Public (external) IP address (same as URL ip) |
version | IP version |
city | City name |
region | Region name (administrative division) |
region_code | Region code |
country_code | Country code (2 letter, ISO 3166-1 alpha-2) |
country_code_iso3 | Country code (3 letter, ISO 3166-1 alpha-3) |
country_fifa_code | FIFA country code |
country_fips_code | FIPS country code |
country_name | Short country name |
country_capital | Capital of the country |
country_tld | Country specific TLD (top-level domain) |
country_emoji | Country emoji flag |
continent_code | Continent code |
in_eu | Whether IP address belongs to a country that is a member of the European Union (EU) |
land_locked | Whether the country is landlocked |
postal | Postal code / zip code |
latitude | Latitude |
longitude | Longitude |
timezone | Timezone (IANA format i.e. “Area/Location”) |
utc_offset | UTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes) |
country_calling_code | Country calling code (dial in code, comma separated) |
currency | Currency code (ISO 4217) |
currency_name | Currency name |
languages | Languages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix) |
country_area | Area of the country (in sq km) |
Something missing?
You can share your thoughts, request new features, report bugs, or ask questions by clicking.
View example response
Error Codes
Field | Description |
---|---|
INVALID_IP_ADDRESS | The provided IP address is invalid. |
RESERVED_IP_ADDRESS | The provided IP address is reserved and cannot be used. |
GEOLOCATION_NOT_FOUND | Geolocation information for the provided IP address could not be found. |
QUOTA_EXCEEDED | The request quota has been exceeded. |
INTERNAL_SERVER_ERROR | An internal server error occurred. |
NO_API_KEY_PROVIDED | No API key was provided in the request. |
UNAUTHORIZED | The provided API key is not authorized. |