Logo

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.

HTTP Request

https://api.ipflare.io/{ip}

URL Parameters

ParameterDescription
ipAn 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

HeaderDescription
X-API-KeyThe API key required to authenticate requests. You can obtain your API key from the API Keys page.
1const res = await fetch('https://api.ipflare.io/84.17.50.173', {
2 method: 'GET',
3 headers: {
4 'X-API-Key': 'YOUR_API_KEY'
5 }
6});
7
8const geoData = await res.json();

Response Fields

FieldDescription
ipPublic (external) IP address (same as URL ip)
versionIP version
cityCity name
regionRegion name (administrative division)
region_codeRegion code
country_codeCountry code (2 letter, ISO 3166-1 alpha-2)
country_code_iso3Country code (3 letter, ISO 3166-1 alpha-3)
country_fifa_codeFIFA country code
country_fips_codeFIPS country code
country_nameShort country name
country_capitalCapital of the country
country_tldCountry specific TLD (top-level domain)
country_emojiCountry emoji flag
continent_codeContinent code
in_euWhether IP address belongs to a country that is a member of the European Union (EU)
land_lockedWhether the country is landlocked
postalPostal code / zip code
latitudeLatitude
longitudeLongitude
timezoneTimezone (IANA format i.e. “Area/Location”)
utc_offsetUTC offset (with daylight saving time) as +HHMM or -HHMM (HH is hours, MM is minutes)
country_calling_codeCountry calling code (dial in code, comma separated)
currencyCurrency code (ISO 4217)
currency_nameCurrency name
languagesLanguages spoken (comma separated 2 or 3 letter ISO 639 code with optional hyphen separated country suffix)
country_areaArea of the country (in sq km)

View example response

Error Codes

FieldDescription
INVALID_IP_ADDRESSThe provided IP address is invalid.
RESERVED_IP_ADDRESSThe provided IP address is reserved and cannot be used.
GEOLOCATION_NOT_FOUNDGeolocation information for the provided IP address could not be found.
QUOTA_EXCEEDEDThe request quota has been exceeded.
INTERNAL_SERVER_ERRORAn internal server error occurred.
NO_API_KEY_PROVIDEDNo API key was provided in the request.
UNAUTHORIZEDThe provided API key is not authorized.

View example error response