How to Create a Google API Key for Sentiment Analysis?

  1. To generate the browser API key, log into the Google Cloud platform and select a project.

  2. Go to API & ServicesLibrary and find the service in this case language in the search bar.

     

  3. Select the Cloud Natural Language API and enable the setting if it is not enabled yet. Once it is enabled, you will be able to click on “Manage.”

     

  4. Once it is enabled, you can navigate to the API & ServicesCredentials section.

     

  5. Within Credentials, click Create Credentials and select API key.

Note: If you don't see the API key, make sure from the menu that you are at the top level of Credentials not within any one of the other services, otherwise some services don't have API credentials so make sure you start from the top.

6. Once you click on the API key, it will automatically generate one. It is always recommended to restrict the key.

7. Name the API key appropriately, and restrict it by either HTTP Referrers or by API only. Now you can save this and copy the API key and use it as part of the language API.