Skip to main content

Step-by-Step Tutorial · Updated for 2026

Last updated: June 12, 2026

How to Get a YouTube API Key in 2026

Getting a YouTube Data API key is free and takes about five minutes in Google Cloud Console. This guide walks through every click — creating the project, enabling YouTube Data API v3, generating and restricting the key, and testing it with curl.

Quick answer

To get a YouTube API key, sign in to the Google Cloud Console at console.cloud.google.com, create a project, enable the YouTube Data API v3 in the API Library, then go to Credentials → Create credentials → API key. The key is free, requires no credit card, and takes about five minutes; usage is capped at 10,000 quota units per day by default. As of 2026 this is the only legitimate way to get a key — there is no "YouTube API key generator".

  1. Sign in to console.cloud.google.com
  2. Create a new project
  3. Enable YouTube Data API v3 in the API Library
  4. Credentials → Create credentials → API key
  5. Copy the key and restrict it (referrer/IP + API)
⏱ ~5 minutes💸 Free — no credit card📊 10,000 quota units/day included

Facts at a glance

WhereGoogle Cloud Console
CostFree, no credit card
Time~5 minutes
Quota10,000 units/day default
Works forPublic data (search, video/channel metadata, comments)
Needs OAuth insteadUploads, private data, captions
Steps5 (plus an optional curl test)

Once your key is live

The OutlierKit API runs beside your Google key with one bearer token and no quota to manage, returning the outlier scores, transcripts, and keyword volumes a Data API key can't.

What Is a YouTube API Key?

A YouTube API key is a credential string (it starts with AIza…) that identifies your application to Google's YouTube Data API v3. You attach it to each request as the key query parameter, and in return you can read public YouTube data: video metadata, channel statistics, playlists, comments, and search results.

It's one of three credential types Google offers, and picking the wrong one is the most common beginner mistake:

API Key

Public, read-only data

Identifies your app, not a user. Reads anything public: videos, channels, comments, search. This is what 90% of projects need — and what this guide creates.

OAuth 2.0 Client ID

Acting as a user

Required for anything private or write-level: uploading videos, editing metadata, managing playlists, reading your own analytics, downloading captions for videos you own.

Service Account

Server-to-server (rarely for YouTube)

Machine identity for Google Cloud services. The YouTube Data API largely doesn't support service accounts — for YouTube you'll use an API key or OAuth instead.

Rule of thumb: reading public data → API key; anything involving a specific user's account or private data → OAuth client ID. If you only want to look up video stats, pull comments, or run searches, the API key below is all you need.

The Tutorial

Create a YouTube API Key in 6 Steps

Creating a YouTube API key happens entirely inside Google Cloud Console. No billing setup, no approval wait — the key is live the moment you create it.

1

Sign in to Google Cloud Console

Go to console.cloud.google.com and sign in with any Google account. No credit card required.

Open console.cloud.google.com in your browser and sign in with a Google account. Any regular Gmail account works — you do not need a Google Workspace account, and you do not need to enter a credit card or enable billing to get a YouTube API key.

If this is your first time in Google Cloud Console, you'll be asked to agree to the Terms of Service. Accept and continue — the console dashboard loads next.

2

Create a new project

Use the project dropdown in the top bar → New Project. Name it anything (e.g. "youtube-data").

Every API key in Google Cloud lives inside a project. In the top navigation bar, click the project dropdown (it sits just right of the "Google Cloud" logo and shows your currently selected project, or "Select a project").

  1. In the dialog that opens, click New Project (top right of the dialog).
  2. Give the project a name — something like youtube-data or my-yt-app. The name only matters to you.
  3. Leave Location / Organization as "No organization" unless you're inside a company Workspace.
  4. Click Create. Project creation takes a few seconds — a notification appears when it's ready.

Important: after creating the project, make sure it's selected in the top project dropdown. Enabling APIs and creating credentials always happens inside whichever project is currently active.

3

Enable the YouTube Data API v3

Navigation menu → APIs & Services → Library → search "YouTube Data API v3" → Enable.

An API key only works for APIs that are enabled in the project. This is the step most people miss — a key created without enabling the API returns a 403 accessNotConfigured error.

  1. Open the navigation menu (☰, top left) and go to APIs & Services → Library.
  2. In the search box, type YouTube Data API v3.
  3. Click the YouTube Data API v3 result (publisher: Google Enterprise API).
  4. Click the blue Enable button. After a moment you're redirected to the API's overview page — that means it's on.

While you're in the Library you may also see "YouTube Analytics API" and "YouTube Reporting API". You don't need those for public data — they cover private analytics for channels you own and require OAuth, not an API key.

4

Create the API key

APIs & Services → Credentials → Create credentials → API key. The key appears instantly.

Now generate the actual key.

  1. From the navigation menu, go to APIs & Services → Credentials.
  2. Click + Create credentials at the top of the page.
  3. Choose API key from the dropdown.

A dialog pops up with your new key — a string that starts with AIza followed by ~35 more characters. That's your YouTube API key. You can copy it right away, but don't close the tab yet — the next step (restricting it) matters.

5

Copy and restrict the key

Edit the key → add an application restriction (referrer/IP) and restrict it to YouTube Data API v3 only.

An unrestricted key works from anywhere, against any enabled API in your project. If it leaks, anyone can burn your quota. Restrict it before you use it:

  1. In the key-created dialog, click Edit API key (or later: Credentials page → pencil icon next to the key).
  2. Under Application restrictions, pick what matches how you'll call the API:
    • Websites (HTTP referrers) — if the key is used from browser-side JavaScript on your domain.
    • IP addresses — if the key is used from a server, cron job, or n8n instance with a fixed IP.
    • None — acceptable only for quick local testing; tighten it before anything ships.
  3. Under API restrictions, choose Restrict key and tick YouTube Data API v3 only.
  4. Click Save. Restrictions can take a few minutes to propagate.

Store the key somewhere safe — a password manager or an environment variable (e.g. YOUTUBE_API_KEY) — never hard-coded in a file you might commit to GitHub.

6

Test the key with curl

Run a search.list request from your terminal. A JSON response with video items means the key works.

Confirm everything works with one request from your terminal (replace YOUR_KEY with your actual key):

curl "https://www.googleapis.com/youtube/v3/search?part=snippet&q=test&key=YOUR_KEY"

If you get back a JSON object with an items array of videos, your key is live. If you get a 403, check that YouTube Data API v3 is enabled and your restrictions allow the machine you're calling from (IP restrictions block curl from other IPs; referrer restrictions block curl entirely).

Quota note: this test call uses search.list, which costs 100 quota units — one of the most expensive read operations in the API. Your free daily quota is 10,000 units, so that's 1% gone on one search. Cheaper endpoints like videos.list cost 1 unit.

That's it. You now have a working, restricted YouTube Data API v3 key with 10,000 free quota units per day. Next: know where to find it again, keep it safe, and understand what it can — and can't — pull.

Where Do You Find an Existing YouTube API Key?

Existing YouTube API keys don't live anywhere on youtube.com — they live in Google Cloud Console, inside the project you created them in. Here's how to find one:

  1. Go to console.cloud.google.com and sign in with the same Google account you used to create the key.
  2. In the top bar, open the project dropdown and select the project that holds the key. If you don't see your key later, this is almost always why — you're looking in the wrong project.
  3. Navigation menu → APIs & Services → Credentials.
  4. Your keys are listed under API Keys. Click Show key to reveal and copy the value, or the pencil icon to edit its restrictions.

If no project contains a key, you never created one (or it was deleted) — just run through the six steps above. Keys can't be recovered after deletion, but new ones are free and instant.

API Key Security Best Practices

A YouTube API key isn't tied to billing, so a leak won't cost you money — but it will drain your daily quota and can get your project flagged. Five habits cover almost everything:

1

Never ship an unrestricted key client-side

Anything in browser JavaScript, a mobile app bundle, or a public repo is readable by anyone. If the key must be used in the browser, restrict it by HTTP referrer to your exact domains and restrict it to YouTube Data API v3 only — then assume it will still be scraped and watch your quota.

2

Restrict by referrer or IP

Server-side keys should be locked to your server's IP addresses. Browser keys should be locked to your domains via HTTP referrer restrictions. Both are set on the key's edit page under Application restrictions.

3

Use environment variables, not hard-coded strings

Load the key from an environment variable (YOUTUBE_API_KEY) or a secrets manager. Add .env files to .gitignore. GitHub scans public repos for AIza-prefixed strings and Google will email you when a key leaks — but by then your quota may already be drained.

4

Rotate a leaked key immediately

If a key ends up in a commit, a screenshot, or a log file, treat it as compromised. In Credentials, open the key and click "Regenerate key" (or delete it and create a new one), then update your apps. Restrictions limit the blast radius, but rotation is the real fix.

5

One key per app or environment

Create separate keys for development, staging, and production (or per project). When one leaks or misbehaves, you rotate just that key — and per-key restriction settings can match each environment's actual call pattern.

Is the YouTube API Key Free?

Yes — the YouTube API key itself is completely free, and so is using it within quota. Every Google Cloud project gets a default allocation of 10,000 quota units per day for the YouTube Data API v3, resetting at midnight Pacific Time. Different calls cost different amounts: most reads (videos.list, channels.list) cost 1 unit, while search.list costs 100. You can't buy more quota with a credit card — increases go through Google's audit and quota-extension request process.

For the full breakdown, see our guides on YouTube API pricing and how the YouTube API quota works.

⚠️ There is no legitimate "YouTube API key generator"

If you searched for a "YouTube API key generator": skip every site offering one. YouTube API keys are issued only by Google Cloud Console through the steps above. Third-party "generators" either hand you a shared, quota-exhausted key, harvest your Google credentials, or both. The real process is free and takes five minutes — there is nothing for a generator to shortcut.

What Can't a YouTube API Key Do?

A YouTube API key reads raw public YouTube data. That's genuinely useful — but a lot of what creators and agencies actually want (benchmarks, transcripts for any video, search volumes) isn't in the YouTube Data API at all.

DataYouTube API keyNotes
Video metadata (title, views, likes, duration)✓ Yesvideos.list — 1 unit per call
Channel statistics (subscribers, total views)✓ Yeschannels.list — 1 unit per call
Keyword search for videos/channels✓ Yessearch.list — 100 units per call
Comments on public videos✓ YescommentThreads.list — 1 unit per call
Outlier / breakout-video detection vs channel baseline✗ NoNo benchmark scoring — you'd have to build it yourself
Transcripts for arbitrary videos✗ Nocaptions.download requires OAuth + ownership of the video
Keyword search volume & competition data✗ NoThe Data API returns videos, not search-demand numbers
Semantic channel search & look-alike channels✗ Nosearch.list matches keywords only, not meaning
AI channel metadata (audience age, focus, gist)✗ NoRaw API fields only — no derived intelligence

The OutlierKit API is a YouTube competitive-intelligence API that returns outlier scores, semantic channel search and similarity, video transcripts, comments, and keyword search volumes as structured JSON — one bearer-token key, 1 credit per call, on OutlierKit Pro ($49/month) and Max ($199/month) plans.

If the rows marked ✗ are what you're actually after — outlier detection against channel baselines, transcripts for any public video, keyword volumes, or semantic channel look-alikes — that layer is what the OutlierKit API ships: one key generated from the dashboard, bearer-token auth, no Google Cloud project, no quota math. Endpoints like POST /outliers/search, GET /videos/:videoId/transcript, and POST /keywords/research return the processed intelligence as JSON at 1 credit per call. Many teams run both: the free YouTube key for raw metadata, the OutlierKit key for the analysis layer. Live reference at outlierkit.com/app/api-docs.

For Pro and Max users

Need more than raw YouTube data?

Your free YouTube API key reads public metadata. The OutlierKit API adds the intelligence layer on top: outlier scores against each channel's baseline, cached transcripts with timed segments, keyword search volumes, and semantic channel look-alikes — one bearer token from the dashboard, no Google Cloud setup, 1 credit per call.

YouTube API Key — Frequently Asked Questions

Quick answers to the most common questions about getting and using a YouTube Data API v3 key.

How do I get a YouTube API key?+

To get a YouTube API key, sign in to Google Cloud Console (console.cloud.google.com), create a project, enable the YouTube Data API v3 in the API Library, then go to APIs & Services → Credentials → Create credentials → API key. Copy the key, restrict it to the YouTube Data API v3, and you're done. The whole process takes about 5 minutes and is free.

Is a YouTube API key free?+

Yes, a YouTube API key is free. Creating one costs nothing and requires no credit card. Usage is limited by a free quota of 10,000 units per day per project, which resets at midnight Pacific Time. Most read operations cost 1 unit; search.list costs 100 units. You can't simply pay for more quota — increases go through Google's audit and quota-extension request process.

How long does it take to get a YouTube API key?+

Getting a YouTube API key takes about 5 minutes. The key is generated instantly when you click Create credentials → API key — there's no approval wait for an API key itself. Only quota increases and OAuth app verification involve a review process.

Do I need a credit card to get a YouTube API key?+

No, a YouTube API key requires no credit card. Unlike many Google Cloud services, the YouTube Data API v3 does not require billing to be enabled. You can create a project, enable the API, and generate a key with a plain free Google account and no payment method on file.

Why is my YouTube API key not working?+

The three most common reasons a YouTube API key stops working: (1) the YouTube Data API v3 isn't enabled in the project the key belongs to — enable it in APIs & Services → Library; (2) the key's restrictions block your request — IP restrictions block calls from other IPs, and referrer restrictions block server-side tools like curl entirely; (3) you've exhausted your daily 10,000-unit quota, which returns a 403 quotaExceeded error until quota resets at midnight Pacific Time.

How do I increase my YouTube API quota?+

The default YouTube API quota is 10,000 units per day per project. To get more, you submit Google's YouTube API Services quota extension request (the audited compliance form), describing your application and why it needs higher quota. Approval isn't automatic and can take weeks. Creating extra projects to multiply quota violates YouTube's API Terms of Service.

Can I have multiple YouTube API keys?+

Yes, you can have multiple YouTube API keys. You can create multiple API keys within one project, and you can create multiple projects each with their own keys. Note that quota is counted per project, not per key — two keys in the same project share the same 10,000-unit daily pool. Using multiple projects specifically to evade quota limits is against YouTube's terms.

When do I need OAuth instead of an API key?+

A YouTube API key only reads public data. You need an OAuth 2.0 client ID whenever you act on behalf of a user or touch private data: uploading videos, editing video metadata, reading a channel's private analytics, managing playlists or comments as a user, and downloading captions via captions.download (which requires ownership). If your app only fetches public videos, channels, comments, and search results, an API key is enough.

Where do I find my existing YouTube API key?+

Your existing YouTube API key lives in Google Cloud Console. Select the project you created it in (top project dropdown), then go to APIs & Services → Credentials. All API keys for that project are listed under "API Keys" — click "Show key" to reveal and copy the value. If you don't see it, you're probably in the wrong project.

Can I use my YouTube API key in Python or JavaScript?+

Yes — a YouTube API key works with any language that can make HTTPS requests. In Python, use the google-api-python-client library or plain requests; in JavaScript/Node, use fetch or the googleapis package. Pass the key as the key query parameter on each request. See our YouTube API Python guide for working code samples.

Using the key from Python? Our YouTube API Python guide has working code samples. Curious about plans? See OutlierKit pricing.

Skip the quota math for competitive research

Your YouTube API key is great for raw metadata. For outlier detection, transcripts, keyword volumes, and channel look-alikes as JSON — generate one OutlierKit API key from the dashboard and start calling.

Explore the OutlierKit API

Written by

Aditi

Aditi

Founder OutlierKit and UTubeKit

AI-Verified

Don’t take our word for it.
Ask AI.

Ask any leading AI what OutlierKit does for YouTube creators.