Table of Contents
What is ipapi, and What Makes it Trusted by 30,000+ Businesses Worldwide?
ipapi provides an easy-to-use API interface allowing customers to look at various pieces of information IPv4 and IPv6 addresses are associated with. For each IP address processed, the API returns a total of 47 unique data points, such as location data, connection data, ISP information, time zone, currency and security assessment data.
- Global Standard in IP Data: ipapi has a long-term collaboration with large Internet Service Providers allowing for the highest level of IP data reliability and accuracy.
- Powerful JSON & XML API: ipapi powered by a rock-solid and highly available cloud infrastructure, the geolocation API returns IP results within milliseconds in JSON or XML format.
- Bank-Grade Security: To keep your information safe, any data sent to and from the ipapi service is encrypted using 256-bit HTTPS (SSL) encryption.
- Tailored User Experience: ipapi delivers a custom-fitted and personal user experience to your customers, no matter which country, language, currency, or time zone.
- Advanced Fraud Protection: ipapi makes use of valuable fraud and security assessment data and protects your website and back-end system from dangerous IP addresses.
- Extensive API Documentation: Learn to use the ipapi API in under 10 minutes using any programming language and fully-featured, interactive API documentation.
The ipapi API is a product built and maintained by apilayer, an Austrian technology company aiming to build a variety of reliable programming interfaces (APIs) and make them affordable for developers and startups. Browse all available products here.
ipapi offers one of the leading IP to geolocation APIs and global IP database services worldwide. This article outlines in detail diverse API endpoints, available options, and integration guides for a scripting language (Python), interactive web-based dashboard (Jupyter Notebook), and desktop applications (Delphi).
5 Ways to Use ipapi for More than Just Locating Website Visitors
IP Intelligence provided by ipapi doesn’t stop at locating website visitors.
Here’s how ipapi customers use the API to enhance user experience, target specific audiences based on location and prevent fraud efficiently:
Time Zone Lookup:
Why should you use ipapi to Enhance your User Experiences?
- Various reliable data providers:
IP address data returned by the API is sourced from a variety of reliable providers, including commercial, non-commercial, and proprietary data sources. Each source is validated using strict mechanisms and monitored constantly, which makes it possible to ensure the highest level of data quality and consistency at any given point in time.
- Very high level of accuracy:
Gathered from a variety of reliable and proven sources, ipapi IP address data comes with the highest level of accuracy and consistency currently on the market. The API is capable of returning precise and valuable information related to more than 2 million unique locations around the world and is updated multiple times during the day.
- Highly scalable services:
ipapi is an API service built on top of highly scalable cloud infrastructure and therefore capable of handling anything from a thousand IP address lookups per month up to several million API requests per hour.
- Real-time update:
At ipapi, we are making every effort to deliver accurate, consistent, and up-to-date IP address data any day of the year. IP data provided by ipapi is updated around the clock with up to 300 data updates, additions, and removals in a given day.
What Real-Time IP to Geolocation Endpoints are Available via the API?
In total the ipapi API is offering 3 API endpoints, each with different functionalities. Here are their short summaries:
- Standard Lookup: Lookup any given IP address.
- Bulk Lookup: Lookup multiple IP addresses in bulk.
- Origin Lookup: Lookup the IP address the current API request is coming from.
How can I Access ipapi API?
First, get your API Credentials here, and set up your subscription plan:
And you can monitor your usage via this dashboard.
API Access Key & Authentication
Next, to check if everything is working properly, just simply run this URL in your favorite web browser:
You will get this API response inside your browser:
Each API response consists of more than 45 different response objects:
|ip||Returns the IP address as requested.|
|hostname||Returns the hostname the requested IP is associated with; requires Hostname Lookup to be enabled.|
|type||Returns IPv4 or IPv6, depending on the type of the requested IP address.|
|continent_code||Returns the 2-letter continent code associated with the IP address.|
|continent_name||Returns the continent name associated with the IP address.|
|country_code||Returns the 2-letter country code associated with the IP address.|
|country_name||Returns the country name associated with the IP address.|
|region_code||Returns the region code associated with the IP address (e.g. NY for New York).|
|region_name||Returns region name associated with the IP address.|
|city||Returns the city associated with the IP address.|
|zip||Returns the ZIP code associated with the IP address.|
|latitude||Returns the latitude associated with the IP address.|
|longitude||Returns the longitude associated with the IP address.|
|location||[Object] Returns multiple objects related to location.|
|location > geoname_id||Returns the unique geoname identifier in accordance with the Geonames Registry.|
|location > capital||Returns the capital city of the country associated with the IP address.|
|location > languages||[Object] Returns an object containing one or multiple sub-objects per language associated with the IP address.|
|location > languages > code||Returns the 2-letter language code for the given language.|
|location > languages > name||Returns the language name (in the API request’s main language). (e.g. Spanish)|
|location > languages > native||Returns the native language name. (e.g. Español)|
|location > country_flag||Returns an HTTP URL to an SVG country flag icon associated with the IP address.|
|location > country_flag_emoji||Returns the emoji icon for the country flag associated with the IP address.|
|location > country_flag_emoji_unicode||Returns the unicode value of the emoji icon for the country flag associated with the IP address. (e.g. U+1F1EA U+1F1F8 for the Spanish flag)|
|location > calling_code||Returns the calling/dial code associated with the IP address. (e.g. 34) for Spain|
|location > is_eu||Returns true if the given country is part of the EU, false if not.|
|time_zone||[Object] Returns an object containing data related to time zone.|
|time_zone > id||Returns the time zone ID associated with the IP address. (e.g. America/New_York for EDT)|
|time_zone > current_time||Returns the current date and time associated with the IP address. (e.g. 2018-03-29T22:31:27-07:00)|
|time_zone > gmt_offset||Returns the offset to GMT time of the given time zone in seconds. (e.g. -14400 for EDT)|
|time_zone > code||Returns the universal code of the given time zone.|
|time_zone > is_daylight_saving||Returns true if the given time zone is daylight saving time, false if not.|
|currency||[Object] Returns an object containing data related to currency.|
|currency > code||Returns the 3-letter code of the main currency associated with the IP address.Example: USD.|
|currency > name||Returns the name of the given currency.|
|currency > plural||Returns the name of the given currency in plural.|
|currency > symbol||Returns the symbol of the given currency.|
|currency > symbol_native||Returns the native symbol of the given currency.|
|connection||[Object] Returns an object containing data related to connection.|
|connection > asn||Returns the Autonomous System Number associated with the IP address.|
|connection > isp||Returns the ISP associated with the IP address.|
|security||[Object] Returns an object containing data related to security.|
|security > is_proxy||Returns true if the given IP address is associated with a proxy, false if not.|
|security > proxy_type||If relevant, returns the type of proxy the IP address is associated with.|
|security > is_crawler||Returns true if the given IP address is associated with a crawler, false if not.|
|security > crawler_name||If relevant, returns the name of the crawler the IP address is associated with.|
|security > crawler_type||If relevant, returns the type of crawler the IP address is associated with.|
|security > is_tor||Returns true if the given IP address is associated with the anonymous Tor system, false if not.|
|security > threat_level||Returns the level of threat the IP address is associated with.|
|security > threat_types||[object] If relevant, returns an object containing all threat types associated with the IP address.|
How can I Track and Monitor any IP Address with Python and ipapi?
Use the following code to make an API request using Python, you can change the “188.8.131.52” value to any IP address you want to verify:
# -*- coding: utf-8 -*-
r = requests.get("http://api.ipapi.com/184.108.40.206?access_key=1b7dca71357cfd86e35aa0e505cdd7e3")
responses = r.json()
Here is the API response inside your Python interpreter:
You also can print out each parameter individually, or choose any parameter you like, like this:
Here is the API response inside your Python interpreter:
How can I Develop Interactive Web-Based IP Address Tracking and Monitoring Systems with ipapi and Jupyter Notebook?
You can easily build an interactive web-based IP Address Tracking and Monitoring dashboard using Python scripts in the previous section, just by running them inside Jupyter Notebook. If you have never used Jupyter Notebook before, visit this link for an installation guide.
Here is the result:
How can I Make an API Request to ipapi using Delphi REST Debugger?
Download Delphi REST Debugger here:
Choose the GET method, and send the request to the following URL:
After getting the API responses you need, and you want to create Desktop apps based on it using Delphi, please refer to this article to get started:
Are you ready to get started improving the UI and UX for your apps?
As you can see there are many real-time IP to geolocation endpoints provided by ipapi REST API which can be connected to any platform and any programming language you work with. In this article, we show the basic demo of how you can use ipapi REST API for scripting, web, and desktop-based applications.
Take advantage of the free tier on ipapi and we recommend you to upgrade your subscription plan if you need more powerful features to improve the UI/UX and the security of your apps (SSL Encryption, Currency Module, Time Zone Module, Bulk Lookups, and many more). We can’t wait to see what you build with our REST API!