Google APIs

Google APIs

Accessing Google products through their APIs can be cost effective and necessary for development purposes. The following documentation discusses how to create a Google Cloud Project, add API access to the Project, create API key credentials, and attach a payment method (optional).

Please note that this documentation is subject to change as Google products update.


Step 1: Access Google Cloud Console and Create a Google Cloud Project

In order to access a Google API, you first need to create a Google Cloud Project

  1. Go to cloud.google.com

  2. Sign in with your Lehigh Account

  3. Click “Console” in the upper right corner

  4. In the Google Cloud Console, (1) click on the workspace button and then (2) select “New project”

  1. Give your project a descriptive name related to your project, making sure that Organization and Location are set to lehigh.edu

  2. Click “Create”


Step 2: Add API access to your Project

Select the API(s) that you would like to access and add them to your Google Cloud Project

  1. Within Google Cloud Console and your project selected, (1) click on the “hamburger” menu in the upper left corner, (2) hover over the “APIs & Services” option, and (3) select “Enabled APIs & services”

  1. Select the API that you would like to use from the API library, or use the search bar to search the available APIs by keyword (e.g. Gemini API)

  2. On the API product details page, click “Enable”

 


Step 3: Create API key and restrict to certain API usage

  1. On the APIs & Services page, (1) click “Credentials” in the left menu bar, (2) click “+ Create credentials”, and (3) select “API key”

  1. A pop-up window will show you the generated API key as a long string of alphanumeric characters (partial example below)

  2. Copy & Paste the API key and store securely for use in your application

  3. To add API restrictions, before closing the pop-up window, click “Edit API key”

API restrictions are one way to securely use API keys by restricting their use to a particular API. Other suggestions for secure use are listed below.

  1. In the API key settings, (1) click on “Restrict key” and (2) select the API key(s) from the dropdown menu that you would like to restrict the use of the API key to

  1. Consider the these recommendations when using API keys:

    • Add API key restrictions to your key

    • Delete unneeded API keys to minimize exposure to attacks

    • Don't include API keys in client code or commit them to code repositories

    • Implement strong monitoring and logging

    • Isolate API keys

    • Rotate your API keys periodically


Step 4: (Optional) Attach payment information

To be able to use some APIs, a payment method is required. Payment methods are attached to Google Cloud accounts and can be added through the Google Cloud Console.

  1. Within Google Cloud Console, (1) click on the “hamburger” menu in the upper left corner and (2) click on the “Billing” option

  2. In the Billing menu on the left, (1) select “Payment method” and (2) click “+ Add payment method”

 

For immediate help, contact the LTS Help Desk (Hours)
EWFM Library | Call: 610-758-4357 (8-HELP) | Text: 610-616-5910 | Chat | helpdesk@lehigh.edu
Submit a help request (login required)