What is ipstack, and how can it increase your security?

ipstack offers a powerful, real-time IP to geolocation API capable of looking up accurate location data and assessing security threats originating from risky IP addresses. Results are delivered within milliseconds in JSON or XML format. Using the ipstack API you will be able to locate website visitors automatically and adjust your user experience and application accordingly.

The ipstack 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.

ipstack 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).

Why should you use ipstack for Developing a Website Visitors Tracking and Monitoring System?

  • Very high accuracy:

Since the ipstack database and API is integrated with a series of large ISPs who constantly provide information about new and existing IP ranges, we are proud to offer a very high level of accuracy in IP data.

  • Real-time update:

ipstack is integrated with multiple channels delivering real-time IP data, which is why the database used by the ipstack API is updated regularly, with up to 24 database updates per day.

  • Handling between 2 to 3 billion API requests per day:

With 9 years of constant optimization, the infrastructure behind ipstack and the ipstack API has grown to become highly scalable and efficient, currently handling between 2 to 3 billion API requests per day.

  • Supporting global network:

Data coverage is growing by the day, with ipstack currently supporting more than 2 million unique locations in over 200.000 cities across the globe.

What Real-Time IP to Geolocation Endpoints are Available via the API?

In total the ipstack API is offering 3 API endpoints, each with different functionalities. Here are their short summaries:

  1. Standard IP Lookup: The ipstack’s primary endpoint is called Standard Lookup and is used to look up single IPv4 or IPv6 addresses. To call this endpoint, simply attach any IPv4 or IPv6 address to the API’s base URL.
  2. Bulk IP Lookup: The ipstack API also offers the ability to request data for multiple IPv4 or IPv6 addresses at the same time. To process IP addresses in bulk, simply append multiple comma-separated IP addresses to the API’s base URL.
  3. Requester IP Lookup: The ipstack API also offers a separate API endpoint capable of detecting the IP address from which the current API request is coming. To use this endpoint, simply append check to the API’s base URL and specify your preferred optional parameters.

How can I Access ipstack 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 49 different response objects:

Response ObjectDescription
ipReturns the requested IP address.
hostnameReturns the hostname the requested IP resolves to, only returned if Hostname Lookup is enabled.
typeReturns the IP address type IPv4 or IPv6.
continent_codeReturns the 2-letter continent code associated with the IP.
continent_nameReturns the name of the continent associated with the IP.
country_codeReturns the 2-letter country code associated with the IP.
country_nameReturns the name of the country associated with the IP.
region_codeReturns the region code of the region associated with the IP (e.g. CA for California).
region_nameReturns the name of the region associated with the IP.
cityReturns the name of the city associated with the IP.
zipReturns the ZIP code associated with the IP.
latitudeReturns the latitude value associated with the IP.
longitudeReturns the longitude value associated with the IP.
location[Object] Returns multiple location-related objects
location > geoname_idReturns the unique geoname identifier in accordance with the Geonames Registry.
location > capitalReturns the capital city of the country associated with the IP.
location > languages[Object] Returns an object containing one or multiple sub-objects per language spoken in the country associated with the IP.
location > languages > codeReturns the 2-letter language code for the given language.
location > languages > nameReturns the name (in the API request’s main language) of the given language. (e.g. Portuguese)
location > languages > nativeReturns the native name of the given language. (e.g. Português)
location > country_flagReturns an HTTP URL leading to an SVG-flag icon for the country associated with the IP.
location > country_flag_emojiReturns the emoji icon for the flag of the country associated with the IP.
location > country_flag_emoji_unicodeReturns the unicode value of the emoji icon for the flag of the country associated with the IP. (e.g. U+1F1F5 U+1F1F9 for the Portuguese flag)
location > calling_codeReturns the calling/dial code of the country associated with the IP. (e.g. 351) for Portugal.
location > is_euReturns true or false depending on whether or not the county associated with the IP is in the European Union.
time_zone[Object] Returns an object containing timezone-related data.
time_zone > idReturns the ID of the time zone associated with the IP. (e.g. America/Los_Angeles for PST)
time_zone > current_timeReturns the current date and time in the location associated with the IP. (e.g. 2018-03-29T22:31:27-07:00)
time_zone > gmt_offsetReturns the GMT offset of the given time zone in seconds. (e.g. -25200 for PST’s -7h GMT offset)
time_zone > codeReturns the universal code of the given time zone.
time_zone > is_daylight_savingReturns true or false depending on whether or not the given time zone is considered daylight saving time.
currency[Object] Returns an object containing currency-related data.
currency > codeReturns the 3-letter code of the main currency associated with the IP.
currency > nameReturns the name of the given currency.
currency > pluralReturns the plural name of the given currency.
currency > symbolReturns the symbol letter of the given currency.
currency > symbol_nativeReturns the native symbol letter of the given currency.
connection[Object] Returns an object containing connection-related data.
connection > asnReturns the Autonomous System Number associated with the IP.
connection > ispReturns the name of the ISP associated with the IP.
security[Object] Returns an object containing security-related data.
security > is_proxyReturns true or false depending on whether or not the given IP is associated with a proxy.
security > proxy_typeReturns the type of proxy the IP is associated with.
security > is_crawlerReturns true or false depending on whether or not the given IP is associated with a crawler.
security > crawler_nameReturns the name of the crawler the IP is associated with.
security > crawler_typeReturns the type of crawler the IP is associated with.
security > is_torReturns true or false depending on whether or not the given IP is associated with the anonymous Tor system.
security > threat_levelReturns the type of threat level the IP is associated with.
security > threat_types[object] Returns an object containing all threat types associated with the IP.

How can I Track and Monitor any IP Address with Python?

Use the following code to make an API request using Python, you can change the “134.201.250.155” value to any IP address you want to verify:

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 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 the 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 Windows, macOS, and Linux Desktop apps based on it using Delphi, visit this blog post to get started:

How can I get started with automated visitor tracking today?

As you can see there are many real-time IP to geolocation endpoints provided by ipstack REST API which can be connected to any platform and any programming language. In this article, we show the basic demo of how you can use ipstack REST API for scripting, web, and desktop-based applications. 

Take advantage of the free tier on ipstack and we recommend you to upgrade your subscription plan if you need more powerful features to grow your business and enhance your security (SSL Encryption, Currency Module, Time Zone Module, and many more). We can’t wait to see what you build with our REST API!

Head over and sign up for free to start building automated IP address tracking systems-based applications today.