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

  1. Sign in to the Google Cloud console ↗ with a Google account.
  2. Create a project, or pick an existing one. A project is only a container for your API settings and quota.
  3. 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.
  4. 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 ↗.
  5. Copy the key. In the Actor input of YouTube Data API Scraper ↗ paste it into the apiKey field, 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:

input.json
{ "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):

FieldValue
typevideo
titleComo Usar Apify en Español (2026)
channelTitleGuia Español
viewCount11193
durationSeconds559
isShortfalse
sourceyoutube-data-api-v3

Errors you may see

Message from the ActorCauseWhat to do
The YouTube API key is invalidTypo or a deleted keyCopy the key again from Credentials.
YouTube Data API v3 is not enabled for this keyAPI not enabled in the project of the keyEnable the API in the same project (step 3).
Your key has IP/referrer restrictions that block this ActorKey restricted by IP or referrerRemove that restriction or use an unrestricted key.
YouTube API quota exceeded for your keyDaily quota usedWait 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

Keep reading