
Do you want to unleash the power of business intelligence around IP addresses? The IP API is powered by one of the powerful & scalable engines on the market – offering the #1 solution for all your IP intelligence requirements in one place.
Start utilizing rock-solid IP data in your projects. By detecting the real-time geolocation of your users, you can give personalized data and stream various ads to different geolocations.
The ipapi is the #1 geolocation with ip lookup RESTful web service in the market and is utilized by 30,000+ businesses worldwide. Because of its simple interface and performance, you can integrate with your project in several minutes.
Table of Contents
What is IP API & why do I need this for my projects?
The ipapi offers Internet Protocol Intelligence. By just knowing your users’ IP addresses you can do these:
- Content Personalization
- Time Zone Lookup
- Language Redirection
- Currency Detection
- Fraud Detection
- Bulk/Volume Lookups
To put it in one sentence, you can target specific audiences based on location and prevent fraud efficiently.
How can I start working with IP API?
Head over to the ipapi website and set up your subscription plan. You can select a Free plan to test it out.

How to use an IP API?
Here is a sample request to the base endpoint and its result:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
{ "ip":"01.001.002.12", "type":"ipv4", "continent_code":"AS", "continent_name":"Asia", "country_code":"UZ", "country_name":"Uzbekistan", "region_code":"TK", "region_name":"Toshkent Shahri", "city":"Tashkent", "zip":"100080", "latitude":41.29949951171875, "longitude":69.24006652832031, "location":{ "geoname_id":1512569, "capital":"Tashkent", "languages":[ { "code":"uz", "name":"Uzbek", "native":"\u040e\u0437\u0431\u0435\u043a" }, { "code":"ru", "name":"Russian", "native":"\u0420\u0443\u0441\u0441\u043a\u0438\u0439" } ], "country_flag":"http:\/\/assets.ipapi.com\/flags\/uz.svg", "country_flag_emoji":"\ud83c\uddfa\ud83c\uddff", "country_flag_emoji_unicode":"U+1F1FA U+1F1FF", "calling_code":"998", "is_eu":false } } |
More on IP API features
The ipapi provides an easy-to-use API interface allowing customers to look at various pieces of information IPv4 & IPv6 addresses are associated with. And the API has different parameters you can configure to have a different set of information.
The API comes with a total of 3 available API endpoints, each covering a different type of functionality.
- Standard Lookup – Lookup any given IP
- Bulk Lookup – Lookup multiple IP addresses
- Origin Lookup – Lookup IP address the current API request is coming from
How to integrate IP API with my Python Flask App?
Well, now the captivating part is started! After signing up, you get your API access key. In this demonstration, we will integrate our Python Flask web app with IP-API. Moreover, this scenario demonstrates how a web API calls other web APIs.
If you configure and protect your Flask API with authentication, this will be a Protected Web API. It is what it is called in the Software Development industry.
How to set up Python Flask App with API for IP addresses?
Now, let’s get into action. Follow these steps, and you will have a working Flask API which calls to another API!
Open your PowerShell or Bash if you have configured. And type these commands.

And type these commands to create a virtual environment for your project. And run the virtual environment, then upgrade your pip.

In my case, I will be using VS Code to code, and we have already opened it with the “code .” command. And open your app.py main file.
Now copy these source codes to your app.py and use HTML web pages for data representation (you can find them from the GitHub repository)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
from flask import Flask, request, redirect, url_for import requests import json app = Flask(__name__) app.config['DEBUG'] = True @app.route('/') def index(): return '<h1>IP API with Python Flask</h1>' @app.route('/result/<string:accKey>/<string:ip>/<string:continent_name>/<string:region_name>/<string:zip_code>/<string:capital>') def result(accKey, ip, continent_name, region_name, zip_code, capital): return '<h3>Continent Name: {}; <br> Region Name: {}; <br> Zip Code: {}; <br> Capital Name: {}; <br> Your Access Key: {};<br>IP:{} </h3>'.format(continent_name, region_name, zip_code, capital, accKey, ip) @app.route('/ipapi', methods=['GET', 'POST']) def ipapi(): if request.method == 'GET': return '''<h1>Please fill out the parameters</h1> <form method="POST" action="/ipapi"> <input type="text" name="accKey"> <input type="text" name="ip"> <input type="submit" value="Request"> </form>''' else: accKey = request.form['accKey'] ip = request.form['ip'] req = requests.get('http://api.ipapi.com/'+ ip + '?access_key=' + accKey) response = req.json() continent_name = response['continent_name'] region_name = response['region_name'] zip_code = response['zip'] capital = response["location"]["capital"] return redirect(url_for('result', accKey=accKey, ip=ip, continent_name=continent_name, region_name=region_name, zip_code=zip_code, capital=capital)) if __name__ == '__main__': app.run() |

Let’s run our IPAPI based Flask Application!
Depending on your configuration on your system you can run your Flask web application with these commands:

Here is the result:


As you can see, it is easy to integrate ipapi from Python Flask or any other programming language.
For instance, Delphi offers cross-platform Low-Code development. With this, you can connect to any API in seconds and create a full-fledged application with a data layer in minutes. Moreover, you can customize your application as much as you like with the Delphi FireMonkey framework which gives you access to low-code tools and Assembly language.
Head over and check out the full source code for the Flask implementation here: https://github.com/MuminjonGuru/IP-API-with-Python-Flask
How can I get started getting business intelligence for IP addresses with ipapi?
Overall, the ipapi is the leading IP intelligence service, and it is utilized by millions of developers around the globe.