In recent years, we have been seeing the rise of cyberattacks and data breaches crippling organizations. Attackers often exploit weak and stolen credentials. Therefore, many organizations are not relying on using usernames and passwords i-e Single-factor authentication anymore. Instead, they are turning to multi-layered approaches, such as Multi-Factor and Adaptive Authentication.
One of the popular methods of implementing adaptive authentication is environment-based authentication. In this method, the system identifies the location of the visitor requesting resources using its IP Address and compares it with an existing record, if the match is not found – the system not only prevents the login attempt but also notifies the user via email about the incident.
This practice is being followed in almost all Web 2.0 Apps. To keep your organization out of the news, It has become essential for developers to improve the security of their applications by implementing multi-layer or adaptive authentication.
That being said, getting and manipulating precise location information using an IP Address has been a pain point for years. Because not many of us want to manually update and manage the database of IP Addresses by ourselves, that not only adds unnecessary complexity but also requires constant support.
Telize API addresses this problem by offering the Geo-Location APIs which can be seamlessly integrated into any application.
What is Telize API?
Telize API is a Geo-Location API that allows users to programmatically lookup the visitor IP address and the geolocation information associated with it.
It supports CORS (Cross-Origin Resource Sharing) and JSONP making it easy to integrate with JavaScript and Single Page Apps.
Telize API provides accurate geolocation data such as:
- User’s IP Address
- Continent Code
- Country
- Country Code (in ISO 3166-1 alpha-2 formats)
- Region
- City
- Postal Code
- Latitude
- Longitude
- Timezone
- Offset
- ASN
- Organization
Telize API can be seamlessly integrated with any mobile or desktop applications using the language of your choice: such as Python, PHP, Ruby, and JavaScript.
How It Works
Telize API provides various endpoints that can be invoked over HTTPS.
The Client application invokes the endpoint by issuing a GET request. The API Server then returns the response using one of the following formats:
- JSON
- JSONP
- Plain Text
Users
Telize Geolocation API can not only improve the security of the application but can also play a vital role in building a robust auditing system.
Therefore, it covers the following areas.
Banking/Financial Applications: Financial and banking application requires sophisticated security design and hence the use of geolocation data for security and auditing purposes has become the newest requirements for them. Many regulatory and compliance requirements enforce the organization to build a well-defined auditing system, that can be used to track any suspicious transaction.
Payment Applications: Telize API can provide an additional security layer in payment processing software and services such as POS Systems, P2P payments, mobile wallets, etc.
Identity Provider Applications:
Identity providers that store and manage user identities can make use of Telize API to implement a location-based auditing system to notify the users of any suspicious login attempt.
Cyber Security Applications:
Telize API provides accurate geolocation data, which can be super helpful for developers building cybersecurity applications, such as preventing DoS, Spam, and other attacks by using geolocation data to filter the suspected traffic.
How to Connect to Telize API Tutorial – Step by Step
You can connect to Telize API using RapidAPI in three simple steps.
Step1: Signup for an Account on RapidAPI
RapidAPI allows developers to find and connect thousands of APIs using One SDK and one API Key. If you don’t have an account, you can signup using this link.
Step2: Subscribe to Telize API
The next step is to subscribe to the API in order to be able to execute its endpoints. The Telize API offers several plans to which you can subscribe as per your business needs.
Navigate to Telize API and click on Pricing Tab. This displays all the available plans. Select a plan that fits your requirements.
The Basic plan allows making 1K requests per day, if you need higher volume, you may consider choosing Ultra or Mega plans, which allow making 20K and 100k requests per day respectively.
Note: If you exceed your plan limits, you will incur overage charges as mentioned on the pricing page.
Once the plan is chosen, click on Subscribe button that will take you to the next page where you can enter credit card information.
Click on ‘Pay Now’ to complete the transaction and subscribe to the Telize API.
Step 3: Test the API Subscription
Let’s test the API subscription using RapidAPI console that allows you to execute and test any endpoint and view its response, without leaving the browser.
Click on the Endpoints tab. All the available endpoints are displayed on the left.
You can test any endpoint and select the code snippet in your preferred programming language, including Python, JavaScript, PHP, and Ruby.
Note: API Key and other required parameters will automatically be generated by RapidAPI Console.
In the below example, the endpoint Location is executed and it successfully returned the JSON response with 200 status code.
Note: In case of any failure, the API Server may return one of the following responses which are explained below:
- 400 Bad Request – Client sent an invalid request (missing required parameters).
- 401 Unauthorized – Failed to authenticate with the API server.
- 403 Forbidden – Client authenticated but doesn’t have permission to access the required resource.
- 404 Not Found – The requested resource (endpoint) doesn’t exist.
- 500 Internal Server Error – A generic error occurred on the API server.
- 503 Service Unavailable – The API service is not available.
Telize API also returns JSON-encoded error message e.g “Input string is not a valid IP address”.
Explanation of Telize API Endpoints
Location with Specified IP Endpoint
This endpoint enables the users to fetch geolocation information for any given IP Address.
It takes ip_address as the required parameter.
The response of this endpoint is a JSON object containing the following elements:
- ip ( IP address specified as a parameter)
- continent_code (Two-letter continent code)
- country (Name of the country)
- country_code (Two-letter ISO 3166-1 alpha-2 country code)
- country_code3 (Three-letter ISO 3166-1 alpha-3 country code)
- is_in_european_union (European Union membership)
- region (Name of the region)
- region_code (Two-letter ISO-3166-2 state / region code)
- city (Name of the city)
- postal_code (Postal code / Zip code)
- latitude (Latitude)
- longitude (Longitude)
- timezone (Time Zone)
- offset (UTC time offset in seconds)
- asn (Autonomous System Number)
- organization (Organization name)
Location Endpoint
This endpoint automatically detects a visitor’s IP addresses and retrieves the associated geolocation information in JSON format.
IP Endpoint
Telize API provides this endpoint to get IP Addresses in a plain-text format. It’s useful in cases where the application does not need to parse the JSON object with additional geolocation data and simply can get the IP address from the response body.
JSON IP
This endpoint can be used to get IP Address (IPv4 or IPv6) in JSON format. The response body will contain the IP Address in JSON-encoded format. It supports an additional callback parameter to support JSONP for cross-site callbacks.
Legacy – GeoIP Endpoint
This endpoint also returns visitors’ IP Address location in JSON format but doesn’t require any additional parameters.
How to Use Telize API with Python
Please make sure that you have installed the Python application. There are several client libraries available for python like http.client, Unirest and the default http.client.
The below example invokes the Location with a Specified IP endpoint using http.client library
import http.client conn = http.client.HTTPSConnection("telize-v1.p.rapidapi.com") headers = { 'x-rapidapi-key': "ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541", 'x-rapidapi-host': "telize-v1.p.rapidapi.com" } conn.request("GET", "/location/%7Bip_address%7D?callback=getlocation", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
How to Use Telize API with PHP
Before running the sample code shared below, please make sure that you have installed PHP. You may follow this guide on how to install this correctly.
The sample code also executes Location with a Specified IP endpoint using the cURL library:
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://telize-v1.p.rapidapi.com/location/%7Bip_address%7D?callback=getlocation", CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "x-rapidapi-host: telize-v1.p.rapidapi.com", "x-rapidapi-key: ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
How to Use Telize API with Ruby
You can use the below code-snippet that uses net::http library to execute the Location endpoint.
require 'uri' require 'net/http' require 'openssl' url = URI("https://telize-v1.p.rapidapi.com/location?callback=getlocation") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE request = Net::HTTP::Get.new(url) request["x-rapidapi-key"] = 'ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541' request["x-rapidapi-host"] = 'telize-v1.p.rapidapi.com' response = http.request(request) puts response.read_body uest) puts response.read_body
How to Use Telize API with JavaScript
To use the API in JavaScript, you need to first set up the JavaScript environment. You can download text editors such as Atoms, Visual Studio Code, NotePad++, etc.
The following code snippet invokes the location endpoint using the JavaScript fetch method that executes and retrieves the response asynchronously.
fetch("https://telize-v1.p.rapidapi.com/location?callback=getlocation", { "method": "GET", "headers": { "x-rapidapi-key": "ce19d0164fmsh3d383efc0e85ce5p16dcb1jsnb1a4a3c79541", "x-rapidapi-host": "telize-v1.p.rapidapi.com" } }) .then(response => { console.log(response); }) .catch(err => { console.error(err); });
In addition to above, RapidAPI also provides code-snippets for other programming languages as well such as C#, Java, Kotlin, Swift, etc.
What are the Benefits of the Telize API?
The Telize API provides several benefits which can be summarized as follows:
- Speed: The Telize API is lightning fast as the average latency is just 83ms. This allows making authentication.
- Security: Telize API can provide accurate geolocation information which can be used to identify and prevent any illegitimate login attempts.
- Fraud Prevention: Financial and banking applications rely heavily on geolocation API to detect and prevent credit card frauds. It can also be used to track and audit suspicious online transactions. With Telizee API, this functionality can be easily implemented into payment processing workflows using a variety of languages and platforms.
- Website Personalization and Customization: Telize API allows developers to automatically detect visitors’ language, timezone, and regional information. This can be incredibly useful to deliver a personalized experience to your visitors. Some of the example use cases can be as follows:
- Translate the website into the user’s language
- Streamline the User Experience by auto-populating fields such as Country, Timezone, etc.
- Run A/B tests based on geolocation information to target the specified audience.
- Employment and Job Portals: This is another use case where job searching websites and services and can leverage geolocation API to match job seekers with opportunities available in their region.
Alternatives to Telize API
Below are few alternatives to Telize API.
- IP Geo Location: This API also returns geolocation information in JSON or XML Formats.
- IPFind.IO: This is a freemium API that allows retrieving geolocation information along with other useful details such as current time, sunset and sunrise time, moonset and moonrise time using any IPv4 and Ipv6 address.
- Free Geo API: This is a free API that can be used to retrieve basic geolocation data using an IP address or a hostname.
- IP Location: This is another freemium API that supports retrieving geolocation information using a given IP Address (in IPv4 and IPv6).
- IPWHOIS.IO: This free API provides comprehensive geolocation information for a given IP address. It only has one endpoint which not only returns geolocation data but also currency information like currency code, symbol, current rate, etc.
Summary
In this article, we learned how we can leverage Telize API to add a layer of security into desktop and mobile applications. We also discussed the various use cases where Telize API can play a vital role in creating a robust auditing system or providing a personalized digital experience.
Some of the promising features of Telize API are the speed, and its ability to be seamlessly integrated using a variety of programming languages and platforms.
Leave a Reply