问题
I'm currently trying to build a project using the youtube api. When doing tests, I had an error which says
"The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>"
I looked at the google cloud console and saw these:
The first screenshot shows I made 38 + 13 requests so I really should have not reached the daily limit yet.
Is this a bug or is it me who didn't understand how the quota limit works?
回答1:
Indeed these pages you're showing maybe confusing.
But you have to acknowledge that YouTube's Data API quota system is not accounting for the number of queries one is making. Instead, the API attaches to each kind of its endpoint a quota cost, and, thus, is accounting for the sum of quota cost of all endpoint calls one is making.
Also worth of noticing is that each failed endpoint call (for whatever reason that happened) gets accounted by the quota system as a completed call.
Furthermore, any given Videos.insert API endpoint call has a quota cost of 1600 units (very expensive); respectively, any given Channels.list API endpoint call has a quota cost of 1 unit (very cheap).
Consequently, by way of elementary arithmetic, you may verify that indeed you exceeded with your API activity the daily quota allocated.
来源:https://stackoverflow.com/questions/63326850/daily-limit-reached-when-uploading-video-to-youtube-using-youtube-data-api