youtube-metadata icon indicating copy to clipboard operation
youtube-metadata copied to clipboard

YouTube API Quotas

Open mattwright324 opened this issue 4 years ago • 6 comments

See mattwright324/youtube-geofind#11 YouTube API Quotas

This issue is shared between these two projects as they share the same YouTube API key.

mattwright324 avatar Dec 23 '20 21:12 mattwright324

If the API key used for the website runs out of quota, is there any way to use the project with a personal key?

CYLITM avatar Mar 13 '22 19:03 CYLITM

Hi @CYLITM,

Yup, in the browser console you can run youtube.setDefaultKey('AIzaSy...'); with your own API key however you'd have to do it on each page load; tampermonkey could do that and you could turn it on and off as needed.

Alternatively, you could spin up your own instance following the notes in BUILD.md.

This application has not yet hit the quota limit yet even though quota has been much higher than usual since the 22nd.

image

mattwright324 avatar Mar 13 '22 20:03 mattwright324

Hi @CYLITM,

Yup, in the browser console you can run youtube.setDefaultKey('AIzaSy...'); with your own API key however you'd have to do it on each page load; tampermonkey could do that and you could turn it on and off as needed.

Alternatively, you could spin up your own instance following the notes in BUILD.md.

This application has not yet hit the quota limit yet even though quota has been much higher than usual since the 22nd.

image

@mattwright324 Do you consider to use temporary browser storage for personal API keys? With use of localstorage there will be no need to reapply personal api key on each page load.

SeanSilke avatar Nov 08 '22 14:11 SeanSilke

Hi @SeanSilke

That can certainly be an option to look into. However, you could probably achieve the same with a tampermonkey/greasemonkey script depending on the browser you are using.

mattwright324 avatar Nov 08 '22 14:11 mattwright324

Since frequently lately the api key is being abused by someone...

Sample Tampermonkey Script for Automatic API Key change as suggested by @mattwright324 - Works for Single Metadata page and Bulk page -

One Click Install Link (make sure to have Tampermonkey installed on your browser)

// ==UserScript==
// @name         Replace Youtube API Key For Matt's Youtube API Metadata Search
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        https://mattw.io/youtube-metadata*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=mattw.io
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Put your Youtube Data API V3 key here
    const API_KEY = 'replaceThisStringWithYourAPIKeyString'


    setTimeout(() => {
        youtube.setDefaultKey(API_KEY)
    }, 500)
})();

wc2184 avatar May 03 '23 02:05 wc2184

Thanks @wc2184 that will be useful for sure, there isn't a whole lot I can do about the quotas. I've linked to your issue message in the quota exceeded warning in the page.

There appears to be some automated process someone is using to run tons of queries as soon as the quota resets at midnight...

image

mattwright324 avatar May 06 '23 13:05 mattwright324