Obtaining IP addresses from your visitors is becoming an ever more crucial part of site management. Because sites are now more global than ever, and every visitor is looking for that personalized experience, the number of IP geolocation APIs has exploded over the last few years.

They’re designed so that you can set them up really quickly (usually just copy/paste the relevant code), and when integrated, they get you instant results.

One of the programs we’ve been using lately is ipwhois.io, and it’s proven to be as good as so highly advertised. We’ll get into more details regarding what it offers and what you’ll have to do to make it work, but let’s first sell you on the need for geolocation in the first place.

Why geolocation

Person holding location pin

The main reason you’d use geolocation is, as we’ve mentioned, to make a more personalized site. This might seem trivial, but actually, it goes a long way towards firstly gaining visitors and secondly retaining them. It’s always refreshing to see a site that has language localization, for instance. Naturally, you need to figure out the numbers, i.e., is it worth investing in an additional language for a dozen visitors – geolocation will get you those numbers.

While language is probably the first thing that comes to mind when talking about localization, it’s by no means the only thing. You can work your magic from the backend to create various targeted actions for specific regions. You won’t put flip-flops on the main page for those that log in from Sweden; instead, you’ll focus on winter coats and hats. These kinds of promotions help you diversify your stock to better target your audience and subsequently increase both your traffic and revenue.

You can also use the knowledge to calculate shipping costs which can mean a lot now that the prices are all over the place.

From knowing your customer’s location, you’ll also know their time zone. Once again, this seems like a trivial thing, but if you run a site that aims for global traffic, you simply need to take these things into account. From the provided data, you can prepare special timed promotions for certain times of day when traffic is at its highest, while on the other end avoiding certain times for anything noteworthy because of lower traffic.

Generally speaking, collecting data that pertains to geolocation helps you identify the structure of your user base. This, in turn, helps you focus your energy on two things – doubling down on the high points (promotions for regions and/or time zones with the highest traffic) and/or trying to work on bringing up the lower points (figuring out how to raise traffic in lesser performing regions and/or time zones).

Why ipwhois.io

ipwhois.io

Now you know why to use geolocation on your site, but why, out of all other services, should you use ipwhois.io.

Price and tier flexibility

There are several reasons to opt for ipwhois.io, first of all, being – it’s free. We know what you’re probably thinking – if the main reason to use something is the price (especially if it’s free), that product or service isn’t all that great anyway. To that, we say – don’t fret, this is just the first thing that really pops up.

As you would expect, there is a caveat – the service is free for up to 10000 requests per month – for those starting out, this might seem like a big number, but it really isn’t. This basically provides the perfect solution if you’re just testing out geolocation services but has the scaling potential to grow with your site as you move up through the tiers.

There are three pricing plans, each of which corresponds with the amount of traffic your site receives, or, if we’re more specific, the number of requests that are made.

ipwhois.io pricing

Easy to set up

Looking at all that code, it’s understandable you’d think the setup process is an arduous task that you’ll need written and video tutorials to finish. In reality, it’s quite the opposite. The free plan doesn’t even require registration.

Depending on what programing language you’re most comfortable with, you’ll be provided with responses in three formats: JSON, XML, and CSV. We all know how important it is to use the tools you’re familiar with, and this type of coverage ensures you’ll have your way. Here, you can find an example of a request made in PHP and response in JSON:

Request:

<?php

$ipAddress = $_SERVER['REMOTE_ADDR'];

$ch = curl_init('http://ipwhois.app/json/'.$ipAddress);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$jsonData = curl_exec($ch);

curl_close($ch);

$resultData = json_decode($jsonData, true);

var_dump($resultData);

?>

Response:

{

"ip": "8.8.4.4",

"success": true,

"type": "IPv4",

"continent": "North America",

"continent_code": "NA",

"country": "United States",

"country_code": "US",

"country_flag": "https://cdn.ipwhois.io/flags/us.svg",

"country_capital": "Washington",

"country_phone": "+1",

"country_neighbours": "CA,MX,CU",

"region": "New Jersey",

"city": "Newark",

"latitude": 40.735657,

"longitude": -74.1723667,

"asn": "AS15169",

"org": "Google LLC",

"isp": "Google LLC",

"timezone": "America/New_York",

"timezone_name": "Eastern Standard Time",

"timezone_dstOffset": 0,

"timezone_gmtOffset": -18000,

"timezone_gmt": "GMT -5:00",

"currency": "US Dollar",

"currency_code": "USD",

"currency_symbol": "$",

"currency_rates": 1,

"currency_plural": "US dollars",

"completed_requests": 0

}

Advanced localization

As previously mentioned, geolocation is essential for localizing your site – through knowing where your visitor is coming from; you also know their language, currency, time zone, etc. All of this can then be used to make a customized frontend just for them. Even through localization, you have several options – you can hone in on wider designations like country or continent, or go super detailed with regions or even cities, everything depending on how your site is dependent on said localizations.

Localization isn’t exclusive to just the frontend. You’ll be able to get multilingual responses on the backend too. If you’re accustomed to working with software in your own language, instead of English, you can get responses in all the major languages like German, French, Spanish, etc.

Correct data

ipwhois.io location data

One of the main issues that might pop up is getting responses with outdated data. Keep in mind we’re not talking about data from the 90s. People who log in through their phones may be moving around, and you don’t want data about where they were an hour ago, but where they are now. To use gamer terms, think of it as lag or response time. ipwhois.io has enough channels integrated into its system that these won’t trouble you, providing you with near-real-life responses. With a large enough global server coverage, there also shouldn’t be any issues related to your location – the average response is around 90 milliseconds across the board.

Security

There are two things to consider when talking about geolocation security. The data/responses you receive from ipwhois.io use 256-bit SSL encryption, meaning you’re safe on that front – this is your “direct” security, enabled by the provider.

On the other hand, you can use geolocation as an added security measure to keep your site and your visitors safe overall.

By using geolocation, you can pinpoint malicious attempts to attack your site before any real harm is done – if there are suddenly thousands of IP addresses coming from Mongolia (when you’ve had dozens over the years), chances are something is afoot. You can track these attempts, block the IPs and ultimately report the potential attack for further investigation.

While not directly an attack, geolocation is also excellent in detecting fraud attempts. Whether it’s something very serious as payment fraud attempts, or less serious such as registration/login fraud, using geolocation, you can identify these situations much easier than you would without it. If you consider that timing is of the utmost importance in these instances, you’ll be glad ipwhois.io is on your side.

Summary

With geolocation becoming a regular part of every successful site, it stands to reason everyone would be using some kind of API. However, there’s still an aversion towards using chunks of code directly on your site for most people because they don’t feel comfortable and instead resort to various tools that do the coding for them.

Newcomers and others alike need to rid themselves of these fears because visitors today have ever-higher expectations of the sites they visit on a regular basis since there’s so much to choose from. Throwing yourself and your site into localizations to cover your main regions has to be put on your agenda as a priority to satisfy the needs of your potential users.

ipwhois.io offers the perfect chance to dip your toe into geolocation with easy-to-use functions, and the highlighted free tier gives you every opportunity to get accustomed to and figure out what geolocation is all about.

Leave a Reply

Your email address will not be published. Required fields are marked *