Almost every tool that reads YouTube data, from a WordPress video plugin to a small script, asks for a YouTube API key first. Getting one takes about five minutes and costs nothing. This guide walks through each step in the current Google Cloud Console, shows how to lock the key down, and explains the quota limits and the errors you are most likely to see.
In short
A YouTube API key is a free credential for the YouTube Data API v3. To get one: create a project in the Google Cloud Console, enable the YouTube Data API v3, open Credentials, click Create credentials → API key, restrict the key to the YouTube Data API v3 and copy it. Each project gets 10,000 quota units a day.
What is a YouTube API key?
A YouTube API key is a long string, starting with AIza, that identifies your Google Cloud project when it calls the YouTube Data API v3. Google uses it to count your requests against the project’s quota and to apply the restrictions you set on the key.
A key only gives access to public data: public videos, channels, playlists and their details. It does not sign in as anyone, so it cannot see unlisted videos or private playlists, and it cannot upload, edit or delete anything. For that you need OAuth credentials (see API key vs. OAuth below).
Is a YouTube API key free?
Yes. The project, the API and the key are all free, and you do not need a billing account. What is limited is how much you can use it: by default each project gets 10,000 quota units per day, which is plenty for most sites. Read requests such as fetching a video’s details cost 1 unit each. More on that in the quota section.
How to get a YouTube API key, step by step
You need a Google account. Open the Google Cloud Console and sign in.
Step 1: Create a Google Cloud project
Click the project selector at the top of the page, then New project. Give the project a name you will recognise later (for example, your site name), click Create, then select the new project so the next steps happen inside it.

Step 2: Enable the YouTube Data API v3
Go to APIs & Services → Library, search for YouTube Data API v3, open it and click Enable. A key from a project without this API enabled is rejected with an “accessNotConfigured” error.

Step 3: Create the API key
Open APIs & Services → Credentials, click Create credentials and choose API key. Depending on your console version, Google either shows the new key right away or first opens a short form where you can name and restrict it.

Step 4: Restrict the key
An unrestricted key works from anywhere, so anyone who finds it can spend your quota. Edit the key and set two things:
- API restrictions: choose Restrict key and select only YouTube Data API v3.
- Application restrictions: pick the option that matches where the requests come from. Websites is for keys used in browser JavaScript on your own domain. IP addresses is for requests sent from a server with a fixed IP. Choose None only when neither fits, for example on shared hosting where the server IP can change.
WordPress plugins call the API from your server, not from the visitor’s browser. A Websites restriction blocks those requests, so use IP addresses or None for a key you paste into WordPress.
Step 5: Copy the key and test it
Copy the key from the Credentials screen. To check that it works, paste this URL into your browser with your key at the end. It fetches YouTube’s own channel and costs 1 quota unit:
https://www.googleapis.com/youtube/v3/channels?part=snippet&forHandle=@YouTube&key=YOUR_API_KEYA JSON reply with the channel’s title means the key is ready. An error message tells you what to fix: see common errors below. (If you restricted the key to IP addresses, this browser test is blocked; test from the tool that will use it instead.)
YouTube API key vs. OAuth: which one do you need?
- API key: enough to read public videos, channels and playlists. Quick to set up, no sign-in.
- OAuth (Client ID and Client Secret): signs in as a YouTube account. Needed to read that account’s unlisted videos and private playlists, and for anything that uploads or edits.
If you are importing someone else’s public channel, a key is enough. If you are importing your own channel and want everything in it, set up OAuth. Here is how to get a YouTube Client ID and Client Secret.
YouTube API quota: limits and costs
Quota is counted per Google Cloud project, not per key, and resets every day at midnight Pacific Time. The current defaults:
- 10,000 units a day shared by most endpoints.
- 1 unit per call for read requests such as
videos.list,channels.list,playlists.listandplaylistItems.list. One call can return up to 50 items. search.listhas its own allowance of 100 calls a day.- Write requests need OAuth and cost more, for example 50 units for
videos.update. - Every request costs at least 1 unit, including requests that fail.
Google changes these numbers from time to time; the current list is on its quota cost page (checked November 2026). When 10,000 units is not enough, submit the quota extension request form for YouTube API Services from Google Cloud. Google reviews how your project uses the API before raising the limit.
Common YouTube API key errors and fixes
- “API key not valid. Please pass a valid API key.” The key was copied incompletely, has extra spaces, or was deleted. Copy it again from the Credentials screen.
- “YouTube Data API v3 has not been used in project … or it is disabled” (accessNotConfigured). Enable the API in the same project the key belongs to (step 2), wait a few minutes and retry.
- “Requests from referer <empty> are blocked”. The key has a Websites restriction but the request comes from a server. Switch to IP addresses or None.
- quotaExceeded. The project used its daily units. Requests work again after midnight Pacific Time; in the meantime, reduce what you fetch.
Using your YouTube API key in WordPress
In WordPress, the key goes into the plugin that reads YouTube. In Video Hub, open Videos → Settings → API & License, expand API key (an optional fallback, used only when no YouTube account is connected), paste the key and save. Test connection in the side panel checks it.

Video Hub recommends connecting with OAuth, which imports any public video plus your own playlists and unlisted videos; once connected, the key is no longer needed. The same tab has a daily quota limit (10,000 by default; raise it if Google granted you more) and shows the estimated units used today, so you can plan big imports. More in the API & License settings guide.
Tips to stay under the quota in WordPress
- Schedule imports to run periodically rather than pulling everything at once
- Import only new videos on each run instead of re-scanning the whole channel
- Keep batch sizes modest: fewer videos per run costs less quota
- Previewing videos on the Import videos page uses no quota, and pages you already loaded don’t cost quota again
- Repair missing thumbnails with Tools → Thumbnails: it works from saved data and uses no quota
- Before refreshing your whole library, the Update videos tool tells you what it will cost
YouTube API key FAQ
Is a YouTube API key free?
Yes. Creating a Google Cloud project, enabling the YouTube Data API v3 and creating a key costs nothing, and Google gives each project a free daily quota of 10,000 units. You do not need to add a payment method to use the YouTube Data API.
Does a YouTube API key expire?
No. An API key does not expire on its own. It keeps working until you delete it or regenerate it in the Credentials screen of Google Cloud, so store it somewhere safe.
Can I use one API key on several websites?
You can, but every site then shares the same project quota of 10,000 units a day. If each site imports a lot of videos, create one Google Cloud project and one key per site.
What is the difference between a YouTube API key and OAuth?
An API key identifies your project and can only read public data: public videos, channels and playlists. OAuth (a Client ID and Client Secret) signs in as a YouTube account, so it can also read that account’s unlisted videos and private playlists, and it is required for anything that changes data.
How do I increase my YouTube API quota?
Fill in the quota extension request form for YouTube API Services in Google Cloud. Google reviews how your project uses the API before it grants more. Until then, cut quota use: import only new videos and avoid repeated searches.



