You can refer to the official documentation from Google on how to get an API Key:
The most important steps are the following:
- Go to the Google Cloud Platform Console.
- Click the project drop-down and select or create the project for which you want to add an API key.
- Click the menu button and select APIs & Services > Credentials.
- On the Credentials page, click Create credentials > API key.
- The API key created dialog displays your newly created API key.
- Click Close.
- The new API key is listed on the Credentials page under API keys.
- (Remember to restrict the API key before using it in production.)
Once you have the API Key, you can add it in the settings page: