banner 728x90

IP geolocation with ipstack (sponsored)

In Mobile Web Development 21 views
banner 728x90

ip geolocation with ipstack sponsored - IP geolocation with ipstack (sponsored)

Knowing where your web visitor is located is an incredible advantage for any website; you can display relative content such as maps, prices and availability, display your content in their likely language, etc. I can not exaggerate how useful that information is. Of course we have the HTML5 Geolocation API, but that is based on permission and even if your service does not neglect its purpose, the geolocation pop-up of the browser may seem scary.

If geolocation is critical to your app, the HTML5 Geolocation API is not reliable enough; instead, you want to use an IP-based location service as a primary or secondary option and I really enjoyed experimenting with ipstack!

Fast hits

  • With ipstack you can sign up for free
  • The only information required is the IP address – ipstack does the rest
  • The country name and code, country, region, zip code and more
  • Response JSON is small, simple and adaptable
  • Receive currency preference of the location
  • Reliable by Airbnb, Microsoft, Samsung, Activision and more
  • ipstack is from apilayer, the same service provider for currency player, eversign and streetlayer
  • With ipstack you can use JSONP

Using ipstack

Based on my previous experience with apilayer APIs, I knew ipstack would be easy to use and did not disappoint. For the basic information about the IP address of a specific visitor, please call the following URL:

http://api.ipstack.com/75.135.72.123
? Access_key = MY_API_KEY
& Format = 1

A simple API response would look like this:


You can also send IP addresses in bulk by separating IPs with a comma:

http://api.ipstack.com/75.135.72.123.75.135.72.124
? Access_key = MY_API_KEY
& Format = 1

## Result: [, ]

With ipstack the developer can also specify output fields, including more information such as the currency of the region:

http://api.ipstack.com/75.135.72.123
? Access_key = MY_API_KEY
& Fields = ip, location, security

You can even use JSONP – no server required:

https://api.ipstack.com/75.135.72.123
? Access_key = MY_API_KEY
& Callback = MY_FUNCTION_NAME

Not needing a server proxy for front-end functionality is such a useful future for developers like myself.

Closing

The only surprise I get when using apilayer IP services is how much information I can get based on so little information; the call URL is always predictable and the answer is always as simple as I had hoped. I was surprised at the moment with ipstack with currency information and developers able to provide the desired response information – APIs usually do not allow you to do that. Ultimately ipstack is exactly what you want in an API: offers as much information as you want, is easy to use and is flexible to use!

banner 728x90
author
Author: 
    Build a user settings store with AWS AppSync
    Build a user settings store with AWS AppSync
    Amazon Cognito Sync is a service that
    Synchronize user settings for Android with AWS AppSync
    Synchronize user settings for Android with AWS AppSync
    Amazon Cognito Sync is a service that
    Script & Style Show: Episode 10: Dojo
    Script & Style Show: Episode 10: Dojo
    In this episode welcome David and Todd

    Leave a reply "IP geolocation with ipstack (sponsored)"

    Must read×

    Top