https://ipgeolocation.abstractapi.com/v1/
? api_key = YOUR_UNIQUE_API_KEY
& ip_address = 92.184.105.98
{
"ip_address": 92.184.105.98,
"city": "Caen",
"city_geoname_id": 3029241,
"region": "Normandie",
"region_iso_code: "FR-NOR",
"region_geoname_id": 11071621
"postal_code": "14949"
"country": "France"
"country_code": "FR"
"country_geoname_id": 3017382
"country_is_eu": true
"continent": "Europe"
"continent_code": "EU"
"continent_geoname_id": 6255148
"longitude": 49.242341
"latitude": -0.352637
"security": {
"is_vpn": false
},
"timezone": {
"name": "Central European Time"
"abbreviation": "CET"
"gmt_offset": "+1"
"current_time": "2020-03-29T07:35:08-07:00"
"is_dst": true
},
"flag": {
"emoji": "🇫🇷"
"unicode": "U+1F1EB U+1F1F7"
"svg": "https://static.abstractapi.com/country-flags/fr_flag.svg"
"png": "https://static.abstractapi.com/country-flags/fr_flag.png"
},
"connection": {
"autonomous_system_number": "AS3215"
"autonomous_system_organization": "France Telecom - Orange, FR"
"connection_type": "wireless"
"isp_name": "Orange S.A."
"organization_name": "Internet OM"
}
}
The IP Geolocation API, like all of Abstract's APIs, is organized around REST. It is designed to use predictable, resource-oriented URL's and to use HTTP status codes to indicate errors.
The IP Geolocation API requires all communications to be secured TLS 1.2 or greater.
All of Abstract's API are versioned. The IP Geolocation API is currently on Version 1.
Your API key is your unique authentication key to be used to access Abstract's IP Geolocation API. Note that each of Abstract's APIs has a unique API key, so you will need different keys to access the IP Geolocation and Email Validation API, for example. To authenticate your requests, you will need to append your API key to the base URL.
https://ipgeolocation.abstractapi.com/v1/
PARAMETER
TYPE
DETAILS
api_key required
String
Your unique API key. Note that each user has unique API keys for each of Abstract's APIs, so your User Avatar API key will not work for as your IP Geolocation API key, for example.
ip_address
String
The IP address to geolocate. Both IPv4 and IPv6 addresses are supported. Note that if you leave this parameter blank, the service will geolocate the IP address from which the request was made.
PARAMETER
TYPE
DETAILS
ip_address
String
The requested IP address
city
String
City's name.
city_geoname_id
String
City's geoname ID.
region
String
State or province in which the the city is located.
region_iso_code
Char[2]
State or province's ISO 3166-2 code.
region_geoname_id
String
State or province's geoname ID.
postal_code
String
ZIP or postal code.
country
String
Country's name.
country_code
Char[2]
Country's ISO 3166-1 alpha-2 code.
country_geoname_id
String
Country's geoname ID.
country_is_eu
Boolean
True if the country is in the EU, false if it is not.
continent
String
Continent's name.
continent_code
Char[2]
2 letter continent code: AF, AS, EU, NA, OC, SA, AN
continent_geoname_id
String
Continent's geoname ID.
longitude
Float
Decimal of the longitude.
latitude
Float
Decimal of the latitude.
connection > connection_type
String
Type of network connection: Dialup, Cable/DSL, Cellular, Corporate
connection > autonomous_system_number
Uint32
connection > autonomous_system_organization
String
Autonomous System Organization name.
connection > isp_name
String
Internet Service Provider (ISP) name.
connection > organization_name
String
Organization name.
timezone > name
String
Timezone's name from the IANA Time Zone Database.
timezone > abbreviation
String
Timezone's abbreviation, also from the IANA Time Zone Database.
timezone > gmt_offset
String
Timezone's offset from Greenwich Mean Time (GMT).
timezone > current_time
String
Current time in the local time zone.
timezone > is_dst
Boolean
True if the location is currently in Daylight Savings Time (DST).
flag > svg
String
Link to a hosted version of the country's flag in SVG format.
flag > png
String
Link to a hosted version of the country's flag in PNG format.
flag > emoji
String
Country's flag as an emoji.
flag > unicode
String
Country's flag in unicode.
To request the geolocation from an IP address,, simply include your unique API key and the IP address you would like to check.
https://ipgeolocation.abstractapi.com/v1/
? api_key = YOUR_UNIQUE_API_KEY
& ip_address = 92.184.105.98
That's all your need to get the geolocation and other data from an IP address! There are only two required parameters: the IP address and your unique API key.
To request the geolocation from an IP address, simply include your unique API key in the template below
$.getJSON("https://ipgeolocation.abstractapi.com/v1/?api_key=YOUR_UNIQUE_API_KEY", function(data) {
console.log(data.ip_address);
console.log(data.country);
})
That's all your need to get the geolocation and other data from a visitor! There is only one required parameter: your unique API key.
The API response is returned in a universal and lightweight JSON format. Below is an example of a response for an IP address location in France.
{
"ip": 92.184.105.98,
"city": "Caen",
"city_geoname_id": 3029241,
"region": "Normandie",
"region_iso_code": "FR-NOR",
"region_geoname_id": 11071621,
"postal_code": "14949",
"country": "France",
"country_code": "FR",
"country_geoname_id": 3017382,
"country_is_eu": true,
"continent": "Europe",
"continent_code": "EU",
"continent_geoname_id": 6255148,
"longitude": 49.242341,
"latitude": -0.352637,
"timezone": {
"name": "Central European Time",
"abbreviation": "CET",
"gmt_offset": "+1",
"current_time": "2020-03-29T07:35:08-07:00",
"is_dst": true
},
"flag": {
"emoji": "🇫🇷",
"unicode": "U+1F1EB U+1F1F7",
"svg": "https://static.abstractapi.com/country-flags/fr_flag.svg",
"png": "https://static.abstractapi.com/country-flags/fr_flag.png"
},
"connection": {
"autonomous_system_number": "AS3215",
"autonomous_system_organization": "France Telecom - Orange, FR",
"connection_type": "wireless",
"isp_name": "Orange S.A.",
"organization_name": "Internet OM"
}
}
Each individual IP you submit counts as a credit used. So, if you submit 20 different IP addresses in a single request, that will count as 20 credits against your monthly quota. Credits are also counted per request, not per successful response. So if you submit a request for the (invalid) IP address "kasj8929hs", that still counts as 1 credit.
The Abstract IP Geolocation API takes an IP address and translates it into a location, as well as many other details, such as an address, timezone, and more.
IP geolocation and IP lookup are terms that are usually used interchangeably. However, individual providers of IP Geolocation / IP lookup services will often provide different information in their response. For example, some will simply provide raw geocoordinates, such as 33° 56' 34.0476'' N and 118° 24' 36.1512'' W, while others while provide additional information, such as the best guess at the location’s address, timezone, and more.
Typically an Internet Service Provider (ISP) will have a particular range of IP addresses that they work with. These ISPs can delegate these different IP addresses to the various users and devices as they connect to the internet. IP geolocation works by looking up a particular IP against the IP ranges owned by particular ISP’s in a given area. This method is similar to how determining the carrier of a particular phone number works in the Abstract Phone Validation API, for example.
While IP Geolocation can be an incredibly powerful and useful tool for developers and web services, there are several drawbacks and limitations to be aware of. First is that IP addresses have limited accuracy. An ISP may shuffle in IP among several users in a given area. Similarly, the location of the IP may not be the exact location of the user using the device associated with that IP. This can be common if a user is using a mobile phone, such as can be detected using the Phone Validation API. Finally, users can use a variety of services, such as virtual private networks or VPN’s, to mask their real IP.
The HTML5 geolocation API, which is able to provide an almost GPS-like location and a much greater amount of precision. However, unlike pure IP based geolocation, the HTML5 geolocation requires a user’s explicit consent. Unless it’s very clear to a user why you need that info and that it’s valuable to the user, it’s unlikely that information will be provided.
In its simplest form, IP geolocation is looking up an individual IP against a series of tables that map various IP ranges to ISP’s and locations. Regional internet registries, such as the African Network Information Centre and American Registry for Internet Numbers. Additional information is added constantly to the fundamental dataset, which is regularly cleaned and cross checked to ensure accuracy.
There are many powerful use cases for IP geolocation API’s and data. These include but are not limited to:
These are just some sample use cases. If you’re interested in producing a case study with Abstract to share how you’re using our IP geolocation API in exchange for some free credits, please contact us at team at abstractapi.com.
We’re constantly working to increase the coverage and accuracy of our data, which improves every week. Currently we support more than 2.25 million unique locations as well as 250,000+ cities and other geographic entities around the world.
Our IP geolocation database is updated at least once a week, as we get new information about each IP block. We take care of keeping that data updated and cleaned so you can focus on providing great geolocation-related services and experiences to your users.
While we always strive to provide the most accurate and up to date information possible. However, if you notice anything inaccurate or missing in our data, please email us at: team at abstractapi.com. If we can identify and replicate the incorrect data you’re seeing, we’ll give you extra credits for reporting it :)
You're in luck then! We have a free tool that lets anyone find their IP and geolocate it, even if you're not technical. You can find it here: What is my IP address and location?
May 4, 2023
-
Increased accuracy of North and South American geolocations, plus expanded the coverage of VPN providers
February 24, 2021
-
Integrated new data set that improves geolocation accuracy by 24% on average
February 17, 2021
-
Allow users to limit what fields and objects are returned in the response
February 26, 2021
-
Improved response time by 23%
November 20, 2020
-
Added VPN and proxy detection to response
This is now available under the "security" object
November 20, 2020
-
Made IP address an optional field
If it's not entered in the request, then the service will geolocate the IP of the requesting server
November 18, 2020
-
Updated country flags to higher resolution versions
August 12, 2020
-
Optimizations that reduced response times 15%
July 20, 2020
-
Improved accuracy of city and region names to geoname ID's
July 4, 2020
-
Country flags updated
Updated the PNG and SVG country flags with higher quality images.
July 2, 2020
-
ASO Database Updated
Our database of names of Autonomous Service Organizations (ASO's) can been updated with the latest data.