MapKit vs Google Places SDK

Today I’ll compare two different ways to search for places for an iOS app.

Nicolas Savoini
The Startup
5 min readJul 16, 2020

--

Photo by Nick Seagrave on Unsplash

If you want to allow your users to search for places in your app, you can use one of two frameworks: MapKit or Google Places SDK.

MapKit is the integrated Apple solution.

Google Places SDK is an external framework created by Google.

For this comparison, we will focus on the search functionality, not on the map displays or interactions.

Summary

Summary table.

Installation

MapKit: The iOS framework integrates with MapKit. There is nothing you are required to do before you start using it.

Google Places: Google Places SDK is distributed by Google via Pod. There are two steps for the framework to work.

First, you need to go to The Google Cloud Platform Console and register for the API.

Then, you need to use the Pod system to add the framework to your project. Even if you are not familiar with the Pod system, the process is simple.

Open a terminal and navigate to your project folder:

pod init #Will create the pod file

Open the Pod file and add the line:

pod ‘GooglePlaces’

Finish the installation with:

pod install #to install the library

Winner: MapKit.

Why: MapKit has no registration and no installation.

Code

The code logic is the same for both frameworks.

With MapKit, you do the search and retrieval of information with one request.

With Google Places, the number of requests depends on the information you need.

For details like name and address, the search request is enough. But if you need more, like the phone number or the website, you will need to fire a second request.

For Google Places, the search request is called the autocomplete request.

The code is similar in both cases. The way to fire the request and process the result is identical.

Winner: No winner here.

Why: Both can give you minimal information with only the search request.

Data

This is where we will see the most differences between the APIs.

MapKit provides only one request for searching for and retrieving data, but the data you get is limited.

You will have access to the:

Each of these is optional, and you might not get them all. The API will provide only one category per location.

Google Places can provide a lot more information, but the retrieval is a little more complicated. Depending on the information you need, you may need to fire multiple requests.

With the search request, you will receive the bare minimum: ID, Name, and a one-line Address.

You will need to send a second request for the rest of the information or even the complete address object. In the call, you will specify which information you want.

For example, if you need the phone number and the website, you will specify GMSPlaceFieldPhoneNumber and GMSPlaceFieldWebsite in the request.

If you do not specify anything, the request will return all possible information. As we will see in the next section, this will impact the cost of the request.

You can see all the possible fields here.

There is another type of request that will let you download photos for the location.

Winner: Google Places.

Why: Google Places has more information available than MapKit.

Price

MapKit is free. You can send as many requests as you want.

Google Places is not free. You have to pay for the requests you make.

The Google Places SDK offers multiple endpoints. The first one for the search is cheap and used when users look for a place. With each letter added to the search, the application sends a new request.

The price of the search request is $2.83 per 1,000 requests.

For the full address and type, the price is $17 per 1,000 requests.

For a place’s contact information — like phone number and website — you need to pay $3 per 1,000 requests.

On the bright side, if you combine an autocomplete request with a details request, the autocomplete request will be free.

Also, Google gives you $200 worth of free usage each month.

Google Places is not free. But depending on your usage and the information you need, you might be able to stay under the $200 monthly limit.

See the Google Places pricing chart.

Winner: MapKit

Why: It’s completely free.

Quality

This data quality analysis is based only on my use case (simple search by name for bars, restaurants, hotel, etc).

In terms of performance, I see no difference between both services. The result of the request is fast enough to keep up with the user as they type. In the case of a speedy typist, the application might not display all the results in between the requests.

The main difference is the quantity of the data.

I observed Google Places providing more results than MapKit. Also, it takes less typed information to find what you are looking for.

Both APIs let you restrict where to search by specifying a country or a geographical zone. With no restriction, I find Google Places’s result to be entirely without limitation. My impression is that MapKit results revert to the device’s country if the user has accepted the localization.

Conclusion

Both APIs let you start getting information very quickly. Both APIs’ minimum code is accessible to all developers and have lots of documentation on the web.

The real difference between MapKit and Google Places is the relationship among the data, the price, and your use case.

Your application will decide which solution is best for you.

For prototyping or a small application, with information like name and phone number, MapKit is the solution.

If you want more information, like opening hours, photos, and reviews, you will have to use Google Places. But this option means you will have to take the cost into account.

There is also a case to be made to use both at the same time.

As the implementation is similar and quite easy, you can use both solutions. If a user asks for a restaurant’s phone number, MapKit will provide it for free. Eventually, if the user asks for more information, you can revert to Google Places.

Your application’s needs will decide the best solution for you.

--

--

Nicolas Savoini
The Startup

Passionate geek, I have few apps on the AppleStore and a lot of ideas:) write about Tech and Life. nicolas.savoini@mac.com