Google Places & solar calculator

Enable address autocomplete with Google Places

Users can still type their address manually, but with a Google Places API key your form can autocomplete and validate addresses as they type. This setup also prepares your Google Cloud project for the solar calculator flow.

Google Places autocomplete Maps JavaScript API Website-restricted API key
What this setup does

Address autocomplete on the main form and geocoding for the savings calculator both use your Google Cloud setup. In Google Solar mode, the Solar API is used when you switch that feature on.

Enable Maps JavaScript API + Places API → Create API key → Restrict it to websites → Paste it into the Solar Capture wizard → Save
1Enable Maps JavaScript API and Places API
2Create an API key with API and website restrictions
3Copy the key into the Solar Capture wizard and save
Wizard overview Places autocomplete + solar calculator
Google Places and solar calculator section in the wizard

Part 1

Enable the required Google APIs

To power address autocomplete, Google Cloud needs both the Maps JavaScript API and the Places API enabled in the same project. Once those are live, you can create a locked-down API key for your website.

1

Open the Google Places wizard section

In Solar Capture, open the Google Places & solar calculator section. This is where you will eventually paste your API key.

Wizard showing Google Places autocomplete and solar calculator cards
Start in the wizard section for Google Places autocomplete and the solar calculator.
2

Enable Maps JavaScript API

Your autocomplete field runs through Google Maps JavaScript. Open that API in Google Cloud and make sure it shows API Enabled.

Maps JavaScript API enabled in Google Cloud
The Maps JavaScript API must be enabled for the autocomplete experience on your website.
3

Enable Places API

Next, enable the Places API in the same Google Cloud project. This allows Google to return matching address suggestions as users type.

Places API enabled in Google Cloud
Places API must also be enabled before you create the key used by the wizard.

Part 2

Create and restrict the API key

For this setup you should create an API key, not an OAuth client or service account. For security, restrict the key to only the APIs it needs, and restrict requests to websites.

4

Create credentials and choose API key

Go to APIs & Services → Credentials, click Create credentials, then select API key.

Create credentials dropdown with API key selected
Select API key for this integration.
5

Limit the key to the required APIs

Name the key clearly, then set API restrictions so it can only access the APIs used by this integration.

  • Maps JavaScript API
  • Places API
  • Places API (New) if your project uses it
  • Solar API if you also want Google Solar mode
API key restriction screen showing Maps JavaScript API, Places API, Places API New, and Solar API
Restrict the key to Maps JavaScript API and Places API. Add Solar API too if you intend to use Google Solar mode.
6

Restrict the key to websites

Under Application restrictions, choose Websites. Then add your website domain so the key only accepts requests from your site.

Website restrictions area for a Google API key
Use website restrictions for better security, and lock the key to your live domain whenever possible.
7

Copy the API key into the wizard

After creating the key, copy it from Google Cloud and paste it into your Solar Capture wizard. Then press Save.

Your form will now use Google Places to validate and autocomplete addresses. Users can still enter an address manually, but autocomplete will make the process faster and more accurate.

Wizard card where the Google Places key is added
Paste the API key into the wizard and save your changes.

Done

Your address autocomplete setup is complete

8

Congratulations

Your form can now use Google Places to validate addresses and improve data capture.

Now might be a good time to set up the Google Solar API as well if you intend to use it.