← Back to Docs

Creating a YouTube API Key

Step-by-step guide to getting your YouTube Data API key

Gorilla uses the YouTube Data API v3 to fetch video information from your selected channels. You'll need your own API key, which is free and takes about 5-10 minutes to set up.

📌 Important Notes

  • The YouTube API is free for typical Gorilla usage (10,000 quota units/day)
  • You'll need a Google account (Gmail, etc.)
  • Your API key stays private and is stored securely as an environment variable
  • No credit card required for the free tier

Step-by-Step Instructions

1

Go to Google Cloud Console

Open your browser and navigate to:

Sign in with your Google account if prompted.

2

Create a New Project

Click on the project dropdown at the top of the page (it might say "Select a project").

Click "New Project" in the top-right of the modal.

Enter a project name (e.g., Gorilla or Family YouTube).

Click "Create" and wait a few seconds for the project to be created.

3

Enable YouTube Data API v3

Once your project is created, use the search bar at the top to search for:

YouTube Data API v3

Click on "YouTube Data API v3" in the search results.

Click the "Enable" button to activate the API for your project.

4

Create Credentials (API Key)

After enabling the API, click "Create Credentials" at the top of the page.

You'll be asked what kind of credentials you need:

  • Which API are you using? Select YouTube Data API v3
  • What data will you be accessing? Select Public data

Click "Next" or "What credentials do I need?"

5

Copy Your API Key

Google will generate an API key for you. It will look something like:

AIzaSyDxxxxxxxxxxxxxxxxxxxxxxxxxxx

Copy this key and save it somewhere secure. You'll need it when deploying Gorilla.

Important: Treat this key like a password. Don't share it publicly or commit it to a public GitHub repository.

6

Restrict Your API Key (Recommended)

For security, it's recommended to restrict your API key so it can only be used with the YouTube Data API.

In the Google Cloud Console, go to Credentials in the sidebar.

Click on your API key name to edit it.

Under "API restrictions":

  • Select "Restrict key"
  • Choose "YouTube Data API v3"
  • Click "Save"

This ensures the key can only be used for YouTube API calls, adding an extra layer of security.

Understanding API Quotas

The YouTube Data API has a free quota of 10,000 units per day. Here's what that means for Gorilla:

Action Quota Cost Example Usage
Fetch videos from 1 channel ~100 units One channel refresh
Initial setup (15 channels) ~1,500 units First build
Daily refresh (15 channels) ~1,500 units Automated rebuild
Daily limit 10,000 units ~60 channels per day

Bottom line: For typical family use (10-30 channels with one daily rebuild), you'll use about 1,500-3,000 quota units per day, staying well within the 10,000 unit free tier.

Troubleshooting

Error: API key not valid

Make sure you've enabled the YouTube Data API v3 for your project. Double-check that you copied the entire API key without extra spaces.

Error: Quota exceeded

You've hit your daily quota limit. Either wait until tomorrow (quotas reset at midnight Pacific Time) or request a quota increase in the Google Cloud Console.

Can't find "Create Credentials"

Make sure you've enabled the YouTube Data API v3 first. The "Create Credentials" button appears after the API is enabled.

Security Best Practices

  • Never commit your API key to GitHub or any public repository. Using Gorilla normally does this automatically for you.
  • Store it as an environment variable in your deployment platform (Netlify, Cloudflare, Vercel, etc.)
  • Restrict the key to YouTube Data API v3 only
  • Optionally, restrict to specific domains or IP addresses where your Gorilla instance will be hosted
  • If you suspect your key has been compromised, regenerate it immediately in the Google Cloud Console
  • Monitor your quota usage in the Google Cloud Console to detect unusual activity

✓ API Key Created!

Now that you have your YouTube API key, you're ready to deploy Gorilla to a hosting platform.