1. Home
  2. Web
  3. Positionstack api review

Get Enterprise-Level Geocoding for Free with the Positionstack API (REVIEW)

You don’t have to be Google Maps to get value from geocoding. And, thanks to Positionstack, you don’t need the Big G’s tech budget to do so, either. Today, we review Positionstack’s robust API, which aims to make enterprise-level forward and reverse geocoding both highly affordable and useable.

PositionStack - Accurate Forward-&-Reverse-Batch-Geocoding-REST-API

Positionstack 101

So, why should you bother reading a 2,000+ word review on Positionstack, and what do you stand to gain? The answer sounds cute, but it’s accurate: the entire world.

Consider for a moment just how many places there are on the world map. Now, multiple that number in your head by every piece of metadata your business needs to know about those places. That’s what Positionstack offers, and then some.

Let’s look at some quick stats about Positionstack:

  • Actual billions of geocoding lookup requests processed every hour, every day; with 100% uptime and < 100ms response times
  • Cloud-based, highly scalable infrastructure
  • Real-time data on every country in the world, compiled into a cavernous dataset that is updated every few hours
  • Generously apportioned, competitively priced subscription plans; plus an unrivaled 10,000-request monthly quota for Free users
  • Integration support for all major programming languages
  • Comprehensive, easy-to-read documentation complete with code snippets
  • A world-class customer satisfaction team with experience serving clients like Zendesk, Slack, LinkedIn, Lyft, Apple and Amazon

Positionstack certainly has its pedigree in check, but in case you’re not convinced by a handful of bullet points, let’s take a deep dive into what it’s like to actually use the API.

Positionstack’s 3-Step Quickstart Guide

If you spend any time on their website, you’ll see that Positionstack really stresses ease of use as a primary selling point to their API. During the signup process, you’ll immediately see that’s quite true. In fact, the first thing you see after typing in your account credentials is a quick roadmap of what it takes to get up and running with Positionstack in three easy steps. Let’s take a look:

  1. Set your API access key – By default, you’re handed an access key that’s ready to go out of the box. However, you can easily reset this down the line as needed.
  2. Choose API endpoints – We cover API endpoints in greater depth next section, but for now just understand that this step refers to configuring what type of data is returned when your app makes a request to Positionstack. It’s here you’ll first see the base URL, which is where you target your requests, but it also appears in the documentation. Finally, we see a sample API request, which consists of just a few easy lines of code.
  3. Application integration – The last step refers to the final integration of Positionstack’s API into your application. There’s a fair amount to know about this process, and most of it is covered in the documentation. The important thing here is: Positionstack’s support team has your back, and will offer as much or as little help you need to configure and integrate their API into your app.

Pretty easy right? APIs may seem intimidating to folks without extensive IT knowledge at first. But right off the bat, Positionstack comforts you with the knowledge that not only is it easy, they’ll help you along the way with incredible documentation of their smart design. It helps they have a passionate team of experts at the ready to help you out as well.

Your Positionstack Dashboard

Doubling down on their core value of user-friendliness, Positionstack offers a streamlined, uncluttered Dashboard from which you can access everything you need to know about your API. Let’s take a look at the sidebar options:

  • Dashboard – Here you’ll find notifications (usually alerting you as you pass certain usage thresholds), then links to both the 3-Step Quickstart Guide and their Documentation page. There’s also an overview of your API key, your current subscription, account details, and payment method.
  • Upgrade/Subscription – You can change your subscription on either of these two options. Upgrade at any time, though if you want to switch between a monthly or yearly plan in either direction, you’ll need to first downgrade to a Free account, then pick the desired option. Positionstack support is willing to assist you if you need help doing this.
  • Account/Payment – These are self-explanatory; either tab will allow you to update your credentials at any time. It must be said that we appreciate that they don’t bury these basic controls in an over-designed, flashy interface. WYSIWYG.
  • API Usage – Likely the tab you’ll revisit most often, here you can find how much of your monthly request quota you’ve eaten up so far. There’s also a handy section showing your usage statistics over time, so you can adjust your strategy accordingly.

API Documentation

Now we get to the heart and soul of Positionstack’s offering: the API documentation. Consider this page your go-to user manual, which details each API endpoint, their parameters, and what sort of information they’ll return.

This page is broken up into five different sections. We’ll go through each, spending some time and verbiage to provide some context for you to better understand what you’ll find.

Getting Started

Here, you’ll find basic functions which apply to every request you make with Positionstack. These are:

  • API Key – Your API key is like a digital passport that you’ll use to access Positionstack’s dataset. Without it, the API is useless to you. If you believe it’s been compromised, you can easily rotate your old key out for a new one.
  • Encryption – 256-bit SSL encryption is used all over the Internet, and is the industry standard for security for a good reason. While you’ll need a Basic plan or better to encrypt your app’s communications with Positionstack’s servers, it’s well-worth the investment on its own. In order to evoke encryption, simply change HTTP to HTTPS in the API base URL. Simple!
  • JSON Callbacks – We won’t get into too many technical details of how this works, but if your API requests are getting stonewalled by same-origin policies, you use JSON callbacks to affect a workaround. Essentially, you request data from an external script, which doesn’t get bogged down with cross-domain issues.
  • API Errors – As with anything, sometimes your API requests will run into errors. Positionstack understands this, and has built into their app an error reporting functionality to help you identify what went wrong. API request failures will automatically return an error object in the JSON format, plus code, message, and context sub-objects to provide context for the error.

API Endpoints

This section documents Positionstack’s meat-and-potatoes functionality, which is to say forward and reverse geocoding. If you’re not 100% sure what the difference is, think of geocoding as a two-way street where you can translate places and addresses written in plain English to location data like coordinates and IP addresses, and visa-versa.

So, you’d use forward geocoding to convert the Eiffel Tower’s location into coordinates. Similarly, you can find out the street address associated with an IP address by using reverse geocoding. Pretty simple, after all!

Forward/reverse geocoding requests

In order to make a basic request for either type of geocoding, you’ll need to append the appropriate endpoint (/forward or /reverse) to the API’s base URL. Next, you’ll provide your access key, then make a query using either a Plain-English location address or its corresponding location data–and, voila! It’ll look something like this:

https://api.positionstack.com/v1/forward
    ? access_key = YOUR_ACCESS_KEY
    & query = 1600 Pennsylvania Ave NW, Washington DC

or

https://api.positionstack.com/v1/reverse
    ? access_key = YOUR_ACCESS_KEY
    & query = 40.7638435,-73.9729691

Of course, Positionstack’s dataset contains much, much more than just addresses and coordinates. You can parse these other categorizations through the use of various parameters. Here’s an example of what a forward geocoding request, querying the White House, looks like:

{
   "data": {
      "results": [
         {
            "latitude": 38.897675,
            "longitude": -77.036547,
            "label": "1600 Pennsylvania Avenue NW, Washington, DC, USA",
            "name": "1600 Pennsylvania Avenue NW",
            "type": "address",
            "number": "1600",
            "street": "Pennsylvania Avenue NW",
            "postal_code": "20500",
            "confidence": 1,
            "region": "District of Columbia",
            "region_code": "DC",
            "administrative_area": null,
            "neighbourhood": "White House Grounds",
            "country": "United States",
            "country_code": "US",
            "map_url": "https://map.positionstack.com/38.897675,-77.036547"
         }
      ]
   }
}

Interestingly, if you were to do a reverse geocoding request using the White House’s approximate coordinates, the returned results would look almost identical, except you’d also see the difference in distance between your coordinates and the White House’s official coordinates as they appear in Positionstack’s dataset.

The reason for this similarity is that both endpoints utilize the same array of GET parameters, and are thus capable of returning (almost) the same response objects. That means that no matter what starting data you have to go by, you can get a full complement of location data in return. (It is possible to narrow these results down using the API’s fields parameter, but we’ll touch on that more later.)

Note: Positionstack’s documentation page fully details each parameter and response object, so be sure to check it out!

Batch requests

The last major heading in this documentation setting deals with batch requests. All you’ve got to do is invoke the batch parameter, then nest multiple query instances (along with your desired parameters) underneath in a single request, and Positionstack’s API takes care of the rest. It’s dead simple, and looks like this:

{
   "batch":[
      {
         "query": "Main Street",
         "country": "US",
         "region": "Minnesota"
      },
      {
         "query": "Main Street",
         "country": "US",
         "region": "Illinois"
      },
      {
         "query": "Main Street",
         "country": "US",
         "region": "Missouri"
      }
   ]
}

Advanced Data

In addition to the basic location parameters, you can further tailor your API requests to return more advanced data. These include:

  • Embeddable Maps – Returns a map_url object linked to your geocoding result, which you can use to create an attractive visual map representation on your website or app.
  • Country Module – Unlike other parameters which return up to a few response objects, country_module returns an incredible array of data about your queried country. It’s not just coordinates and addresses, either; it’s the capital, flag, official name, status as a landlocked (or not) country, currencies used, languages spoken, calling codes, and more.
  • Sun Module – Humorously, Positionstack’s documentation describes this as “Astrological” data. You won’t be getting your horoscope with this parameter, but you will see data about when the sun rises and sets, according to astronomical, civil, and nautical chronology.
  • Timezone Module – Append timezone_module to return a location’s GMT offset in either seconds or as a natural language string.
  • Bounding Box Module ­­– If a single x/y pair of coordinates isn’t right for your task, try a bounding box, which encloses an area with minimum and maximum values for longitude and latitude.

Additional Options

The Positionstack API has a ton of data to throw at you, but luckily it provides you with additional tools to manage this trove of information.

  • Specify Response Fields – We’ve covered in depth how much data Positionstack can return, but keep in mind that all that data comes at a cost. If you want to limit your monthly requests, you can do that with the fields Appending fields = results.flag, for example, will cause the API to output only your queried country’s flag. You can invoke fields as many times as you need to get the specific dataset you require.
  • Specify Output Format – Free subscribers are limited to the JSON format for their returned geocoding results. Paying customers, however, can append output on their requests to specify JSON, XML, or GeoJSON as necessary. 

Code Examples 

When Positionstack says they’re here to help you, they mean it. We’ve already seen how thorough their documentation is, but they top it off with handy code examples in all the languages their API supports. We’re not going to copy/paste that code here, but for quick reference, those languages are:

  • Python
  • Nodejs
  • jQuery
  • Go
  • Ruby

Proof and performance

At this point, it should be clear that Positionstack is capable of doing quite a lot. But, how well does it do these things?

First, let’s consider some context. Positionstack is one of 20+ API microservices in Apilayer’s cloud-based ecosystem. Together, these APIs serve over a million B2B clients from startups all the way up to enterprise. Some of their most notable customers include Amazon, Apple, Slack, LinkedIn, and many more household names. Clearly, they’ve got some robust infrastructure to handle this scale of demand.

On its own merits, Positionstack lives up to its pedigree, with an incredible 100% uptime throughout 2020 at the time of writing. This is even more impressive when you consider the API routinely processes over a billion geocode lookups per day per whale client, not to mention the dizzying array of simultaneous requests coming from their stable of SMB customers. What’s more, these requests typically garner responses between 10 and 100 ms.

In our book, that’s something of a technological marvel, especially considering how aggressively priced this SaaS offering is.

And it’s not just raw power that makes Positionstack so appealing. Their dataset is truly sophisticated, sourced from reliable names like Nominatim, GeoNames, Pelias, and OpenStreetMap. Positionstack cross-checks, filters and recombines this wealth of data multiple times a day, pushing regular updates via smart algorithms that ensure you always have highly accurate location data, anywhere in the world, and in real time.

We hate to spoil our final verdict, but if you’re looking for a robust, scalable geocoding solution, Positionstack’s resume demands a closer look.

Pricing 

Apilayer set out to provide an affordable alternative to highly expensive enterprise-level geocoding software, and towards that end they have succeeded.

PositionStack - Free Address Geocoding & Maps API

Positionstack comes in five pricing tiers, and supports monthly billing, or yearly subscriptions at a 20% discount. Those tiers are:

  • Free – Rated for personal use, you’re still getting a good bit of mileage with 25,000 monthly requests for forward and reverse geocoding, outputted in the JSON format. You don’t get a lot of advanced features or customer support, but we’ve already shown you what a valuable resource their Documentation page is. This tier is free of charge, and free of obligation–you don’t even have to provide credit card details to get started.
  • Basic – The entry-level commercial package. Basic subscribers quadruple their monthly quota to 100,000 geocoding requests, plus get access to advanced features like HTTPS encryption, multiple output options (JSON, XML, GeoJSON), embeddable maps, multiple languages, and more. Get a commercial Positionstack license for just $9.99 per month.
  • Professional – Positionstack’s most popular offering, the Professional tier offers a tenfold increase in geocoding requests–up to 1,000,000 per month. All the goodies from the Basic tier are present and then some, notably including batch requests for heavy-duty applications. This tier clocks in at $49.99 per month.
  • Business – Moving into enterprise-scale performance, the Business tier balloons the monthly quota to a whopping 3,000,000 requests. Once again, every advanced feature is fully available, backed by Positionstack’s passionate customer support team to help you get the most out of them. $99.99 per month.
  • Enterprise – This is the tier in which standard offers go out the window, and the customer is king. You have precise needs that demand custom solutions, and Positionstack is at the ready to achieve your goals. You dictate your monthly volume requests, even (especially) if they’re variable. Need more horsepower from the API? Reach out to support for custom-built solutions. Contact Positionstack for a quote.

Verdict

Positionstack does precisely what it set out to do: bring enterprise-level geocoding down from price points otherwise out of budget to most SMBs, without sacrificing performance. Their API is well-documented and easy to use, but features robust integration across all major programming languages for maximum utility. The number of requests Positionstack routinely handles is staggering, while their dataset is smartly maintained for truly global reach in real-time geocoding. If you’re in the market for this type of product, don’t sleep on Positionstack.

What sort of integration do you have planned? How will you make use of geocoding in your business? Do you have any questions or comments on Positionstack? Leave us a note in the comments below.