Closed calzoneman closed 4 years ago
From 2/26 onward there is a steep dropoff in cache hit rate compared to found rate (implying a cached row exists but does not return a 304). Need to investigate what changed.
Cache hit rate recovered, but we hit the limit again. Next steps:
Also need to fix the error message.
I'm having the exact same problem on my project, OpenTogetherTube. I've used up all my quota for the past 4 days, mostly on search results. I'm considering using web scraping to do youtube searches instead. Here's some of my strategies to reduce quota usage:
Where did you find the specific formulas for calculating quota usage? I can't find anything super useful on the official docs.
Also, using multiple API keys across different projects is against the youtube api ToS.
Are you still operating with the default limit of 10,000 units? If so, yeah, that will be spent pretty quickly. In ye olden days, the default was 50,000,000, into which my API key was grandfathered, but they recently adjusted that automatically and capped me at 450,000.
I submitted a request last night to ask them to bump me to 550,000 since I already was asked to complete a mandatory audit recently, so I already had most of the materials ready to fill out the form.
The calculations above are specific to the request pattern that I make for these scenarios, but I computed it by hand by adding up numbers from the docs, e.g. https://developers.google.com/youtube/v3/docs/videos/list#part and https://developers.google.com/youtube/v3/docs/search/list.
There's also this calculator, but I haven't tried it: https://developers.google.com/youtube/v3/determine_quota_cost
Yeah I'm under the 10,000 limit. It sucks. I put in a request a few days ago for more quota, but I doubt I'll get a response anytime soon because of the coronavirus.
I found that calculator as well, but it's not super useful.
Update: for CyTube, most of the usage comes from the search functionality. I've temporarily disabled search and saw a drastic decrease in quota usage. Next options:
It probably needs to be examined; how many people actually use the search functionality on cytube. I for one have never use the search feature on cytube. Simply searching on separate tab has been sufficient. Frankly speaking, the search on cytube doesn’t anything to the platform, and doesn’t add anything to the search engines of youtube, vimeo, dailymotion, etc… In my opinion, removing the search functionality from cytube would most likely not be noticed by the vast majority of users.
@Settit: there is still channel libraries, which get used almost constantly, so the search box isn't going anywhere.
I still believe YT search box should be ran as a separate project, and thus ran under it's own API key.
But if it must be torn out, I suggest replacing it with a Vimeo search. Since it was only some YT terms very specific about inclusion in a mixed list of video search results being disallowed that prevented it's inclusion long ago.
I just got a response to my API quota request, and apparently it's a ToS violation to store information from the youtube API for more than 30 days, and I need to link to Youtube's ToS in my ToS/privacy policy page.
Just giving y'all a heads up, you may get a similar response.
Yep I'm aware, YouTube audited my application before my quota increase request and my service terms were updated accordingly.
YouTube demanded I remove several player-interacting controls like the skip video button and whatnot, then penalized me with a 50% cut in quota, etc. Whew.
Closing since CyTube is getting by with disabled search.
Background
Quota usage
status
,contentDetails
,snippet
Possible solutions/workarounds
ETag
and doing a cache revalidation (still costs 1 unit to make the request, but saves 6 units if the video hasn't changed -- the particular 3 parts CyTube requests probably don't change often)Load balance across multiple API keys? Given the default limit is 10K this may not help all that much, and I would need to check if it's against their ToS for the API