How To Make An App To Convert IP to Geolocation
Wouldn’t it be nice to know where your customers access your website from and customize user experiences based on IP?! 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 at first glance and adjust your user experience and application accordingly. In this article we will see how fast and easy it is to use RAD Studio and Delphi to create a Firemonkey multidevice application using the LowCode Wizard in addition to a REST client library to take advantage of ipStack API and retrieve a JSON format response for IP to geolocation in real-time. ipstack API has years of partnership with large ISPs ensure accurate and consistent data any day of the year and covers over 2 million unique locations in more than 200.000 cities around the world. Our RAD Studio and Delphi applications will be able to call the API and request information based on the name of parameters you provide. How do I set up the IpStack API? Make sure you refer to IpStack API website (https://IpStack.com/) and and SignUp for the free Plan providing only your email and some basic information (no credit card required). Once you are in the website will redirect you to a Quickstart guide dashboard and your API Access Key will be provided. The Access Key unique, personal and is required to authenticate with the API. Keep it safe! How do I call IpStack API endpoints? Now all we need to do is to call the API base URL (http://api.ipStack.com/) via a HTTP POST method with no JSON request body needed and some few requested parameters added to the URL address depending on the ednpoint we choose to call. One can do that using REST Client libraries available on several programming languages. ipStack offers three API endpoints to choose from: Standard Lookup: Look up the data behind an IP address. Bulk Lookup: Look up the data behind multiple IP addresses at once. Requester Lookup: Look up the data behind the IP address your API request is coming from. Our demo will focus on the Standard Lookup Endpoint but all the others follow similar logic but with different parameters passed. For a complete and detailed list of endpoints and its parameters make sure you refer to IpStack Quickstart guide (https://ipStack.com/quickstart) // Standard IP Lookup – look up the data behind an IP address http://api.ipstack.com/134.201.250.155 ? access_key = YOUR_ACCESS_KEY // optional parameters: & fields = ip,location,security & hostname = 1 & security = 1 & language = en & callback = MY_CALLBACK & output = json // more parameters available please refer to the API Documentation (https://ipStack.com/documentation) // Standard IP Lookup – look up the data behind an IP address http://api.ipstack.com/134.201.250.155 ? access_key = YOUR_ACCESS_KEY // optional parameters: & fields = ip,location,security & hostname = 1 & security = 1 & language = en & callback = MY_CALLBACK & output = json // more parameters available please refer to the API Documentation (https://ipStack.com/documentation) What does the IpStack API endpoint returns? After the call the main results will be as shown below. {“ip”:”35.208.128.246″, “type”:”ipv4″, “continent_code”:”NA”, “continent_name”:”North America”, “country_code”:”US”, […]
