Alternatives to Google Maps & Places API
Last May, Google announced the new pricing model for their Maps, Routes and Places API. Where the cost was previously zero or zero, the cost for medium to large sites can now go up significantly. In this article, we explore ways and alternatives to reduce costs without sacrificing essential functionality.

Until July 16, 2018, using the API was still free for small usage; more consumption required only a simple identification. In the new pricing model, you pay in proportion to your consumption. In it, the cost per call is tiered: the more you consume, the less you pay per call. Moreover, the first $200 of your usage per month is free of charge, making a simple ticket on a small-to-medium-sized website still free. However, if you have a website with several tens of thousands of visitors or more then you will have noticed that the costs have suddenly risen sharply. For example, for some sites that experience high visitor spikes due to periodic campaigns, we would already start paying several thousand euros(!). The outlier is a site where costs would exceed €40,000. So time for a different approach.
Approach 1: Optimization
Because costs were previously virtually zero, the pressure to minimize the number of calls to the Google API was not tremendously high. In many cases, however, the number of calls can easily be reduced by the following optimizations:
Defer calls
In many cases, we were making calls to the API where the data was not needed until a later time. As a result, calls were made whose data might not even be used. By removing these, we were able to drastically reduce the number of calls.
Adding caching
The data could often be stored (temporarily) to be used again later. Or if the basic data (like address) doesn't change, we don't need to make another call to the API. Google allows caching provided the goal is to improve speed, not necessarily to make fewer calls to Google. Reducing the number of calls through caching has had a huge effect, but here we quickly entered a twilight zone.
Approach 2: Store data locally
The Dutch government's key principle is to make Dutch government data centrally viewable and accessible. It does this through a portal website with an enormous amount of datasets; from liveability indexes of neighborhoods in the Netherlands to election results per municipality.
The information we as Unc Inc need is twofold. On the one hand, for the addresses, postal codes, neighborhoods, districts, boroughs, cities, municipalities and provinces of the Netherlands, we are mainly concerned with the name (and possible aliases, e.g. Den Bosch and 's-Hertogenbosch), the geographical form and location of this section. In addition, we want the structural information: which cities fall within which municipality, which zip codes fall within which city, etc. In particular, we use the data for looking up and completing addresses, suggesting places based on user input, and showing information on the map.
Part of the available data is the geographic data from the Basic Registration of Addresses and Buildings (BAG). This dataset contains information of the geographical shape (polygons) of areas, such as postal codes. Furthermore, there are so-called PC4 and PC6 datasets available. PC4 provides all postal codes in the Netherlands, containing all residences, municipalities and provinces.
Both datasets are copyright free and may be copied and used locally. As an approach, we wrote a simple import script that combines these data and stores them locally in a database. This makes them ready to use for our sites, free of rights, licenses and API calls, and thus free of (external) costs.
For many sites, this approach is sufficient, and solves the cost problem. However, the data lacks a degree of sophistication. For example, we miss the aliases of place names but - more importantly - we miss all the villages, hamlets and hamlets. And there are quite a few of them. However, datasets for villages, hamlets, hamlets and aliases do not seem to be available on the open data portal.
Approach 3: The National Georegister
Exactly for purposes like ours, the National Georegister (NGR) has been created, the result of a collaboration with Public Services on the Map. The service is an online provision of the above open data but actively maintained and combined into more useful data. As a user, the service is offered under a Fair Use policy and no further rights can be granted to the service. For businesses (or individuals), they do not guarantee uptime, current data, or provide further support. However, usage is completely free and free and includes almost all the data we need. The only restriction, however, is that it only contains information from the Netherlands and is therefore not suitable for projects that reach across borders.
NGR offers a web service based on the Solr search engine. This allows a developer to set up a direct integration with his/her software. Being Solr, the syntax of the Web services is fairly standard. Features like spellchecking are also offered, so even erroneous user input can be traced back to possible results.
Several datasets are available but two below are particularly interesting:
Suggest
This dataset provides suggestions of possible place names (and associated information) based on a user's input. Each object in this dataset has an ID.
Lookup
This one provides more information about a specific object, based on an ID.

Alternatives
Of course, both open data and the NGR may not be the right dataset for your platform. Besides the limitation to Dutch data, it does not contain commercial data, for example, so searching for certain places like stores or restaurants will not give results. In addition, these do not use user feedback, either implicitly or explicitly. Implicitly, Google can use usage statistics to determine and improve the relevance of certain places. Moreover, as a user, you can explicitly give feedback on data quality, make suggestions and add data. All this is a much more direct process than giving feedback on the quality of data coming from a municipality.
Of course, there are alternatives to Google, which is likely to be flooded with new customers since their new pricing model. The biggest alternatives are:
Mapbox
Mapbox has been a good alternative to Google Maps for years and is particularly interesting because of its focus on map interaction. They provide their own software for creating custom tilesets. They give complete freedom in the design of the maps and go much further in this than competitors. You can use a large set of predefined, stylized maps. These range from maps for car navigation or hiking to stylistic maps that resemble a watercolor drawing. Their proprietary software for displaying interactive maps is based on WebGL which makes the maps work smoothly and give sharp images at all zoom levels. Moreover, you can integrate their maps with Leaflet giving you complete freedom in combining with other data sources.
However, Mapbox also provides APIs with location information, the alternative to Google Places. Their basic plan for both maps and location information is free, only after a certain number of requests per month you start paying a fee that is much lower than Google.
TomTom
TomTom was the biggest player for years with their devices for GPS navigation. Although it was obvious to open up their data for external use, their online APIs have not been available for a very long time. It is therefore too early to judge the quality but our first impressions are that the data is very complete. However, the focus still seems to be on driving, something that is not always relevant for specific uses. Also, at first glance, their maps seem less beautiful and are mostly functional.
Bing Maps
Bing Maps is Microsoft's alternative to Google Maps and at first glance appears to be a direct copy. But as can be expected from Microsoft, their pricing model is complex and the page of information quickly leads to the submission of a request for proposal. Their Azure API environment seems more informative, but provides comparative pricing like Google's.
Good luck!
All in all, there are plenty of ways to offer map functionality without incurring huge costs. If optimization doesn't provide the solution, there are always a number of alternatives. If you still need help with implementation, please send an email to info@uncinc.nl. Of course your additions are also welcome, so we can enrich the article with them. Thanks in advance!