Home / Data guides / How to get a free YouTube Data API key
How to get a free YouTube Data API key
The YouTube Data API v3 uses an API key for public data such as videos, channels and comments. You create it in the Google Cloud console in a few minutes. The steps below follow Google's own documentation.
Updated 2026-11-25
Steps
- Sign in to the Google Cloud console ↗ with a Google account.
- Create a project, or pick an existing one. A project is only a container for your API settings and quota.
- Enable the API: open the API Library, search for "YouTube Data API v3" and click Enable. Google's getting started page ↗ says to check the Enabled APIs list and enable it from the library if it is missing.
- Open the left menu, go to APIs & services, then Credentials. Click Create credentials and choose API key. These are the steps of Google's API key help page ↗.
- Copy the key. In the Actor input of YouTube Data API Scraper ↗ paste it into the
apiKeyfield, which is a secret field.
None of these steps asks you to add a billing account, and Google's getting started page does not list one. Console screens change, so if yours asks for billing, stop and check Google's page before you continue. We could not log in to the console while writing this and have not clicked through the screens ourselves.
Protect the key
- Treat the key like a password. Anyone who has it uses your quota. Do not paste it in a public repository, a screenshot or a shared sheet.
- In the key settings you can restrict which APIs it may call; limiting it to YouTube Data API v3 is sensible.
- Do not restrict the key by IP address or by website referrer. The Actor runs on Apify servers, and with such a restriction it stops with the message that your key blocks the Actor.
A first test run
Start small so a mistake costs little. This input asks for 5 videos and uses one search page:
{ "apiKey": "YOUR_KEY", "searchQueries": ["apify tutorial"], "maxResultsPerQuery": 5, "order": "viewCount" }This real output sample comes from a run like that one on 24 Nov 2026 (first video, shortened):
| Field | Value |
|---|---|
| type | video |
| title | Como Usar Apify en Español (2026) |
| channelTitle | Guia Español |
| viewCount | 11193 |
| durationSeconds | 559 |
| isShort | false |
| source | youtube-data-api-v3 |
Errors you may see
| Message from the Actor | Cause | What to do |
|---|---|---|
| The YouTube API key is invalid | Typo or a deleted key | Copy the key again from Credentials. |
| YouTube Data API v3 is not enabled for this key | API not enabled in the project of the key | Enable the API in the same project (step 3). |
| Your key has IP/referrer restrictions that block this Actor | Key restricted by IP or referrer | Remove that restriction or use an unrestricted key. |
| YouTube API quota exceeded for your key | Daily quota used | Wait for the reset at midnight Pacific Time or lower your limits. See quota per operation. |
Without a key
Search and channel modes need the key. Without it only videoUrls work, in a basic mode that reads the public watch page. In our cloud test only 1 of 5 videos returned data, because YouTube often serves datacenter addresses a page without data. Use a key for anything you plan to repeat.
Questions
Is the key free?
The API has a free default quota of 10,000 units per day for most endpoints plus 100 search calls per day, according to Google's quota documentation. You pay the Actor a small price per result (videos $0.002, channels $0.002, comments $0.001); the API usage itself is yours and is free within the quota.
Do I need OAuth?
No. Reading public videos, channels and top-level comments with an API key does not need a login on the YouTube account.
Can I use one key for several projects?
A key belongs to one Google Cloud project, and the quota belongs to the project. Two Actors using the same key share the same quota.
Sources
- YouTube Data API: getting started ↗
- Google API Console help: create an API key ↗
- YouTube Data API: quota and costs ↗