Introduction
The Google Places API is a service able to return information about locations, using HTTP requests. Locations are defined internally to this API as as establishments, geographic locations, or prominent points of interest. It is possible to use the Google Places API with the most important programming languages. Google offers already implemented client libraries for Java, Javascript, Python, Objective-C and Go. It is however possible to use the Google Places API on every programming language supporting HTTP requests. This guide explains how to use Google Places API, properly configuring your Google account and creating an API key for it. In particular, here you will find:
- How to properly set up a Google Cloud project to use the API
- How to create an API key for your Google account to use the API
- How to use the Google Places API with standard HTTP requests for every programming language
How to create an API key for Google Places API
Requirements to meet in order to be able to create a new API key to be used for Google Places API are the following:
- A gmail or a Google Workspace account
- A valid physical or virtual credit/debit card
A gmail or a Google Workspace account is needed in order to access your Google Developers Console, where you will be able to create a new API key. Google Places API will need your workspace project to be linked to a valid payment method to successfully process requests. Here are the detailed steps you are required to follow:
- Access your Google Developer Console with your gmail or Google Workspace account
- Create a new project, eventually linked to an organization in case you’ve been logging into a Google Workspace account
Enabling the Google Places API
Enable “Places API” under the “Library” section of the Google Developer Console. You will be required to create a new billing account or, eventually, to associate one, if already existing. You will be required to enter valid payment information, otherwise you won’t be able to correctly enable your API. Google won’t charge your payment method until you overcome the monthly $200 free threshold. You can get more information about API pricing at the Google Places Pricing page.
Creating an API key for Google Places
At this point, an API key should be automatically created. Copy down your API key and limit its usage to the “Places API”. If an API key isn’t created automatically, you will only have to go to the “Credentials” section of your Google Developer Console, then to create a new “API Key“. Whenever your API key is created, you should always apply restrictions to libraries able to use it.