IP Geolocation API
IP Geolocation API
Abstract’s IP Geolocation API is a fast, lightweight, modern, and RESTful JSON API that determines the location and other details of IP addresses from over 190 countries.
GET
IP Geolocation API
It’s very simple to use: you only need to submit your API key and an IP address, and the API will respond with the location of that IP including postal code, city, region, country and lat/long data.
This was a successful request, so the IP address and details associated with it are returned below:
The response would look like this:
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.
Getting started
REST
The IP Geolocation API, like all of Abstract’s APIs, is organized around REST. It is designed to use predictable, resource-oriented URLs and to use HTTP status codes to indicate errors.HTTPS
The IP Geolocation API requires all communications to be secured with TLS 1.2 or greater.API Versions
All of Abstract’s APIs are versioned. The IP Geolocation API is currently on Version 1.Your API Key
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 APIs, for example. To authenticate your requests, you will need to append your API key to the base URL.Base URL
Validation endpoint
Abstract’s IP Geolocation API simply requires your unique API key and will automatically detect the IP address from the client where it is called. You can also append the “ip_address” parameter to specify the IP to analyze:Request parameters
Your unique API key. Note that each user has unique API keys for each of Abstract’s APIs, so your IP Geolocation API key will not work for your Email Validation API, for example.
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.
You can chose to only receive a few fields from the JSON response. To do so, you can include a fields value in the query parameters with a comma separated list of the top-level keys you want to be returned. For example, adding ?fields=city will return only the city in the JSON response.
Response parameters
The API response is returned in a universal and lightweight JSON format.The IP address submitted for geolocation.
City’s name.
City’s geoname ID.
State or province in which the the city is located.
State or province’s ISO 3166-2 code.
State or province’s geoname ID.
ZIP or postal code.
Country’s name.
Country’s ISO 3166-1 alpha-2 code.
Country’s geoname ID.
True if the country is in the EU, false if it is not.
Continent’s name.
2 letter continent code: AF, AS, EU, NA, OC, SA, AN.
Continent’s geoname ID.
Decimal of the longitude.
Decimal of the latitude.
Whether the IP address is being used from a VPN or using a proxy
Timezone’s name from the IANA Time Zone Database.
Timezone’s abbreviation, also from the IANA Time Zone Database.
Timezone’s offset from Greenwich Mean Time (GMT).
Current time in the local time zone.
True if the location is currently in Daylight Savings Time (DST).
Link to a hosted version of the country’s flag in SVG format.
Link to a hosted version of the country’s flag in PNG format.
Country’s flag as an emoji.
Country’s flag in unicode.
The currency’s name.
The currency’s code in ISO 4217 format.
Type of network connection: Dialup, Cable/DSL, Cellular, Corporate.
Autonomous System number.
Autonomous System Organization name.
Internet Service Provider (ISP) name.
Organization name.