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.

  1. First, you will need to log into the Google Developers Console.

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

  3. 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.

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

  5. 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.

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

  7. 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

    In this field, you would define the exact url that will be used to process OAuth requests. For more information on this, take a look at Google's Redirect URI documentation.

    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.

  8. 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.

Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

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!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!