How can I calculate my YouTube API usage?
Asked Answered
M

3

64

I'm building a pretty large app for a client that is going to aggregate feeds from various sources. My client estimates around 900 follow-able users will be in this system to start out, with more being added over time. He wants to update the feed data every 15 minutes, so we would need to update one user feed per second, assuming 900 feeds and a 15 minute TTL. As the requests take a few seconds to complete, we would then need to load balance across a few threads to tackle the queue asynchronously.

Should I be worried about quota errors or hitting any kind of limitations? If so, what are our options?

I've already read their help pages and documentation, but it's very vague; I need concrete numbers. It's not feasible to load test their API to figure out the limitation.

Mindexpanding answered 22/3, 2013 at 10:46 Comment(0)
E
118

Version 3 of the YouTube Data API has concrete quota numbers listed in the Google API Console where you register for your API Key. You can use 10,000 units per day. Projects that had enabled the YouTube Data API before April 20, 2016, have a default quota of 50,000,000 per day.

You can read about what a unit is here: https://developers.google.com/youtube/v3/getting-started#quota

  • A simple read operation that only retrieves the ID of each returned resource has a cost of approximately 1 unit.
  • A write operation has a cost of approximately 50 units.
  • A video upload has a cost of approximately 1600 units.

If you hit the limits, Google will stop returning results until your quota is reset. You can apply for more than 1,000,000 requests per day, but you will have to pay for those extra requests.

Eras answered 22/3, 2013 at 21:49 Comment(8)
Are these the anonymous limits, and where can I find concrete quota numbers for requests with a valid OAuth token?Insured
According to their documentation here: developers.google.com/youtube/v3/getting-started, a simple read operation that only retrieves the ID of each returned resource has a cost of approximately 1 unit. A write operation has a cost of approximately 50 units. A video upload has a cost of approximately 1600 units.Eras
This doesn't answer what are the options, if you do hit the limitation... Does it mean there are none?! :(Apocarpous
@Cawas If you hit the limits, Google will stop returning results until your quota is reset. You can apply for more than 50M requests per day, but you will have to pay for those extra requests.Eras
@MattKoskela Can I use multiple api key in same app to get more quota?Rosetta
@VikashKumarVerma I'm sure that's against their TOS, but either way it would defeat the entire purpose of having quota's in the first place. I would suggest requesting an increase in quota.Eras
Hi @MattKoskela How can i apply for pay for those extra requests ? Not found any related documentationLime
@RajeshSmartwebtech you can see that documentation here: developers.google.com/youtube/v3/guides/…Eras
F
24

There is a calculator provided by YouTube to check your usage. It is a good tool to estimate your usage.

https://developers.google.com/youtube/v3/determine_quota_cost

screenshot of calculator page on the Google Developers site

Furnary answered 20/7, 2015 at 12:36 Comment(0)
G
3

If you need to make more requests than allotted, you can request a higher quota here: https://support.google.com/youtube/contact/yt_api_form

Glace answered 18/9, 2020 at 8:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.