Skip to content

Generating a YouTube API key

Kieran edited this page Jun 10, 2024 · 6 revisions

Preamble

You can give Pinchflat a YouTube API key if you need Fast Indexing to be even faster and more accurate.

Most users don't need this, but it can make a huge difference if you're attempting to archive videos that are often quickly deleted or restricted after uploading OR if you want the quickest and most reliable media updates possible.

Note

By default an API key can perform Fast Indexing for ~65 sources with a polling interval of 10 minutes. If there's an issue with your API access the app will fall back to RSS.

Caution

You are at Google's mercy when using the API. If they don't like what you're doing they can restrict/revoke your API access entirely or, potentially, even ban your Google account.

I don't think this is likely to happen, but as a best practice I strongly recommend performing these steps with a burner Google account that's completely separate from your main account.

Generating the key

  1. Visit the Google Cloud Console
    • IMPORTANT: make sure you're using the expected Google account. You can select the account you're using in the upper right
  2. Create a new project. Note that the text you see in the upper left may be different than mine:
  1. Give your new project any name. Leave the other settings as-is unless you know what you're doing
  2. Search for and enable the YouTube Data API v3:
  1. Generate a new API key:
  1. Copy that new key and save it for later
  2. Lock down that API key so it can only be used for the YouTube Data API v3:

Using the key

  1. Add the key to Pinchflat and it'll automatically be used for Fast Indexing going forward:

Verifying that it works

  1. Wait for the next Fast Indexing run to occur
  2. Afterwards, check your logs. If you see Fetching recent media IDs from YouTube API and you DON'T see Failed to fetch YouTube API, you're in business!