Generating Google API keys

Getting Google API keys is quite an easy process. If you need to connect to services such as Google Drive or Google Maps from your website or another remote server, you will need a Google API key. The Google Developers Console can be used to obtain Google API keys with just a few simple steps.

Once on your Google Developers Console, create a new project. To do so, click the Create Project button on the top left.

Once the button is clicked, enter a project name. You may use the project ID that is already populated for you as this is simply a unique identifier used on Google's end, or you can create your own. Then, click Create.

It can take a few minutes to create the project for you. Once created, you will be taken to that project.

From within your new project, click on APIs & auth. You should now see a list of services. Locate the API service that you want to use, and click on OFF to switch it to ON. That API service is now active on your account.

Now, you'll need to generate your API credentials. To do so, click on Credentials on the left side of the page.

The information that you need to generate will vary depending on your application that uses the Google API. If you are using a service that will require user authentication such as uploading files to Google Drive, then you will need to create an OAuth Client ID. If you are creating an application that simply relays data from Google such as generating maps with Google Maps, then you will need a Public API Key.

Key generation for OAuth applications

To generate an OAuth Client ID, click on the button that says Create New Client ID. You will then be presented with a popup box that asks for the type of application, as well as authorized JavaScript origins and redirect URI.

Application Types

Web application: This is an application that will be run within a web browser over a network such as a connection from a website.

Service account: This application type will allow your server to make a request to Google's servers, but the response back will not require user consent. For more information on this type, take a look at Google's documentation.

Installed application: This application type is used for an application that is physically installed onto a user's hard drive and runs locally on their computer.

Authorized JavaScript origins

In this box, you will enter the location that your API calls are coming from. For example, you could enter http://example.com in this box. If you have additional domains that will be accessing the Google API, you may enter them on new lines.

Authorized redirect URI

Public API key generation

To access services that do not require user authentication, such as Google Maps, you will need to use a public API key. To generate one, click on Create New Key. You will have a few different key options to generate:

Server key: Select this if you will be making API calls from a server.

Browser key: Select this option if you will be making API calls from the user's browser.

Android key: If the user's Android phone or tablet will be making the API call, use this option.

iOS key: This option is used for making API calls from an iPhone, iPad, or iPod.

Now that you have generated your Google API key or OAuth credentials, you will see them displayed in the Credentials page. You are now ready to use this information within your application.

Was this article helpful?

×

Please answer the follwing questions to help us improve this article.

Is the information out of date or inaccurate? Is the guide complete? Are there spelling or grammatical errors? Are there broken links on the page?

Additonal Feedback

2560

Characters Remaining:

×

One being hard and ten being easy.

How easy were the instructions to follow?
How easy was it to find the guide you were looking for?

Was your issues resolved?

Additional Feedback

2560

Characters Remaining:

News / Announcements

Related Questions

Here are a few questions related to this article that our customers have asked:

Ooops! It looks like there are no questions about this page.

Would you like to ask a question about this page? If so, click the button below!