This is how to get Google Maps API key:
1. Go to the Google Cloud Platform Console and login using your Gmail ID or create an account.
2. Click the project drop-down on the top of the page and select or create the project for which you want to add an API key.
3. Navigate to credentials page: APIs and Services > Dashboard in navigation menu on the left.
4. Click Enable APIs and Services button on the top of the page
6. After that navigate to APIs and Services > Credentials
7. Click Create Credentials button on the top of the page and choose API Key from a drop down.
That is all, simply copy your API key.
Restrict API key
One more important step that we suggest to do is to restrict your key. You can always do this by clicking pencil icon opposite your API key on APIs and Services > Credentials page.
If you are going to use it for google maps extension for Magento 2 store then you can add following restrictions:
and add your website in Application restrictions so this key can only be used on your website.
We suggest to add restriction after you setup google map on your website. In this case if map won’t work you will now that it is due to wrong restriction and not other map/extension settings.