How to get and use my own Maps Api Key?

When would I need my own Maps Api Key?

  1. For a G Suite domain-wide premium plan including all the users in the domain

  2. For heavy usage that won't comply with our fair usage policy,

    • Either related with a high traffic web pages, with linked or embedded map

    • Or for doing intense Routing calculations for business applications

    • Or other causes that might hit our shared Maps Api key way above the average user

Note: Using your own Maps Api key is an extended feature, currently available only by invitation. Contact us if you get to this page but cannot access this feature within the add-on.

How to get my own Maps Api Key?

  • Go to the Google Cloud Platform (GCP) console an sign in with your Google account

  • If it is your first time at the console, you'd be asked to accept the Terms and create a billing account

  • You can also review the Google Maps Platform main page for more details

  • Create a new project and enable the APIs: Maps JavaScript API, Places API, Directions API

  • Create a credential API key (copy the key for further use)

  • Restrict the key usage to calls from the Mapping web app,

    • By selecting "Application restrictions - HTTP referrers (web sites)" and adding websites/paths as follows

mapping.thexs.app/map*

    • Or with an optional -suffix (with a dash) of your choice for increased protection like

mapping.thexs.app/map-xyz.html

  • Click Done and Save

  • You need to enable Billing for your Maps API key to actually works

How to use my own Maps Api Key?

  • Let us know the email account that will be entering the Maps Api Key in the add-on Preferences, for us to activate that option, then

  • Go to the Mapping Sheets add-on Preferences and select the Map entry

  • Enter your Maps Api key and the optional suffix if you choose to have that

  • Save your Preferences and BUILD your map(s) again

  • If using a -suffix (like xyz), your "custom" Mapping page would be like map-xyz.html

  • All your future maps will use your own Maps Api key

How much would it cost to use my own Api keys?

  • It is very unlikely you would pay anything for using your own Maps APIs

  • Google provides 200 USD credit every month and also 300 USD for the first year trial

  • The 200 USD monthly credit covers a lot of usage for the Maps APIs, see more details on their pricing page

  • When Google introduced this new pricing/credit system, they estimated that only a 2% of all global users of the Maps APIs would go over the 200 USD monthly credit

  • In Google's own words: "With the monthly $200 free credit for Maps, Routes, or Places, the vast majority of customers find their use cases to be completely free"



TL;DR

The following information is not intended to replace or to be an alternative of the Google official documentation around Maps Api and it might be out of date, so all the details and screenshots below are just for context as-is.

Getting started at the Google Cloud console

  • You must agree to the Terms to continue and create a new project

  • Click select a project and create a new project

  • You can edit the proposed Project name and ID if you like or leave them that way

  • Then click Create and wait until you get the confirmation

Enable the required Maps APIs

  • Click on the “Create Project: … Just now” link to open your brand new project

  • Click on “Go to APIs overview” to configure your project APIs

  • Google populate a new project with a bunch of APIs, but we are not using any of those so far, just check on “Hide unused APIs” or later remove them all as you wish

  • Hide unused APIs option didn’t work when writing this page, so we disabled them all for clarity, it’s painful, but not required, you can leave them there

  • Click on “Enable APIs and Services” button or the “API library” to enable the required APIs one at a time

  • When there, you can either search for the word “Maps” or just click on Maps “View All (15)” link

For the Mapping web app, you would need to enable the following APIs

  • Maps JavaScript API

  • Places API

  • Directions API

For Geocoding in bulk server-side feature, you need to enable the following APIs (this feature is not yet available)

  • Geocoding API

We will create and configure different API keys for both cases, Mapping and Geocoding

Create the required Maps API keys

  • Go back to the APIs and Services dashboard from the navigation menu

  • Click on Credentials menu option and then on Credentials button and select the “API key” option

  • The console will create a new API key (copy it for further use), then click on “Restrict Key”

For the Mapping web app API key

  • Select “HTTP referrers (websites)” under “Application restrictions”

  • And “Add an Item” as follows, with an optional -suffix of your choice, for improved protection

mapping.thexs.app/map-xyz.html

  • And click Done

For Geocoding in bulk server-side feature

  • Select “Restrict key” under “API restrictions”

  • And check “Geocoding API” from the APIs list

Finally, click on the Save button, at the bottom of the page

Use your Maps Api key with the Mapping web app

  • Go to the Mapping Sheets add-on Preferences > Map

  • Enter your Maps Api key and optional suffix

  • Save your Preferences and BUILD your map again

Known common issues when using your Maps Api key

  • If you don't enable and configure Billing successfully, you will get a "Sorry! something went wrong message", with details in the console asking to enable Billing in the console

  • If you or somebody uses the Maps Api key from a Url page not listed as authorised, it would get a "Sorry! something went wrong message", with details in the console about the referrer not allowed