Youtube API: Download and upload playlists - youtube-data-api

I'd like to manage the playlists on my account automatically with a program I'm going to write. To this end, I took a look at the youtube API. However, it seems to me that the only sensible way to do that is to have a Google G Suite account in order to get access to the OAuth 2.0 API. At the same time, it confuses me that I need to pay a monthly fee just to be able to manage my own playlists. Am I missing something or is this indeed the only way?

You actually don't have to pay anything for normal operations (e.g. if you're able to function within the boundaries of the default quota allocated to your app). To manage (ie. list/create/modify/delete) your channel's playlists you'll have to use the following API endpoints:
Playlists.list, Playlists.insert, Playlists.update and Playlists.delete;
PlaylistItems.list, PlaylistItems.insert, PlaylistItems.update and PlaylistItems.delete.
For read-only operations on public data it suffices to have an application key.
For write operations you'll have to familiarize yourself with OAuth 2.0 authorization in the context of this API. See a brief top level description given by one of my recent answers. Then you'll have to go through the official docs referred to therein.

Related

Is it possible to dynamically query Google APIs to see how much of the limit/quota you've used?

For a given Google API, is there any way to dynamically check usage against any of the current limits for that API?
For example, this page https://developers.google.com/classroom/limits?hl=en shows that I can query the Classrooms API 4,000,000 times per client per day. At midday, without going to the API Console, how could I know that I've already hit 3 million queries?
I'm hoping that there's a billing or usage API that covers this, but can't see it.
Note: I'm not having any issue right now with a specific call, just anticipating that my usage will scale up significantly in the next few months, so am looking for a solution for monitoring rather than advice on not hitting the limits at all. My specific use-case is for Google Classrooms, but reading wider around this I can't see a general solution either.
Answer:
No, dynamically you can't retrieve this information.
Feature Request:
You can however let Google know that this is a feature that is important for the Google Workspace APIs to have, and that you would like to request they implement it.
The page to file a Feature Request for the Google Classroom API is here, as there is no specific component for Google Workspace APIs in general I would suggest filing it here instead.
You can use Google's Cloud Monitoring API to achieve this. This is the documentation page for APIs-
https://cloud.google.com/monitoring/api/v3
This is the documentation page for concerned metrics-
https://cloud.google.com/monitoring/api/metrics_gcp#serviceruntime/quota/allocation/usage
https://cloud.google.com/monitoring/api/metrics_gcp#serviceruntime/quota/exceeded
https://cloud.google.com/monitoring/api/metrics_gcp#serviceruntime/quota/limit

YouTube Data API daily quota reduced to 0

For some reason, I started getting 403 errors on my app(in development), the errors message was
Access Not Configured. YouTube Data API has not been used in project XXXXXXXX....
This is weird because I was using the API for the last month or so with the same project, and didn't do any changes.
After looking in the project settings I noticed that the daily quota was reduced to 0.
The only thing concerning the API that I did was to request a quota increase in order to keep developing(The default quota stalled the dev on the search functionality of my app), but I didn't get any answer concerning that request other than asking for info, no warnings, or anything really.
I'm pretty sure that my app complies with the Terms of service, so I don't think that is the reason.
Any help would be appreciated. Thanks!
I would check your email it sounds like your project was disabled. Have you been though the verification process?
YouTube reserves the right to disable or curtail your access to, or use of, specific YouTube API Services if your API Project has been inactive for 90 consecutive days. For example, YouTube could revoke your API Credentials, or reduce (or eliminate) your API Project's quotas for specific YouTube API Services. If your API Client's quota is reduced or eliminated, you may reapply for quota or a quota extension, and YouTube will review that application based on YouTube’s determination of your expected use of the YouTube API Services.
I would check your email. I have several emails about projects i no longer use which have had the quota reduced to 0 over the last few weeks.
How to reset
No matter what the clients you have now are not going to work you need to reset the project.
Delete all client ids you have now.
deactivate then reactivate all APIs you need
Create new client ids keys
If you're trying to use an old project, then it's not gonna work. You'll have to create a new project.
Create a new project.
Enable Youtube API for it. (Your quota will be reset to 10,000/day)
Get new API key for it.
Use the new credentials.

How to bulk update "Authorized JavaScript Origins" in Google API Console?

Currently, I have been tasked to utilize the Google People API to ask for a user's basic Google information along with their public phone numbers. So far the results have been positive.
The solution my team and I have incorporated the Google People API integration in has the capacity to be utilized across thousands of domains. As a result, my question is simply, How can my team members and I ensure that any our clients that utilize our solution with their own particular domain get our new functionality built with the Google People API?
Keep in mind, our clients have the flexibility to have http/https and any subdomain on their site. Entering each domain possibility for our client base one by one would not be an easy task. I'm seriously hoping there is a solution around the single, explicit origin entries.
Thank you for your time and help.
Warning:
You must remember that if this is source code you are giving your clients that you are not allowed to release your client id and client secret. This includes plugins and scripts.
On November 5th 2014 Google made some changes to the APIs terms of Service.
Asking developers to make reasonable efforts to keep their private
keys private and not embed them in open source projects.
So if your clients could view the code of your application and see your client id and secret you should not be giving it to them.
Read more about this issue Can I really not ship open source with Client ID?
Recommendation:
The best solution for you will be to instruct your users now to create there own project on Google Developer Console and create their own JS origins.
You may just have to provide your own wrapper around the target API where you authorize the client request yourself and then do the request from Google using your own credentials.

Extending YouTube API Quota with limited funds

With a simple java program, I send GET requests using YouTube Data API specifically videos.list, in order to get the public metadata of a video and store it as .json files.
For my universities research, we have to do this with all available YouTube video IDs provided in the Youtube-8M Database.
Therefore, I would like to know if there is a way to extend the available quota for requests (I already know about the billing option, but I am a student and my university is small).
I have read the YouTube API terms, which states that only one project per client may be used to send such requests with the necessary API Key.
If I understand it correctly, even my simple java code is such a client.
In some other Stack Overflow questions about extending ones daily quota with API Keys, some suggested creating multiple accounts or projects.
Is this a legal option or not? Or is there another possibility to get a higher quota for simple requests used in research like I do right now?
If you go to the Google Developer console where you enabled the YouTube API. the second tab is called quota
Click the pencil next to which ever quota it is that you are blowing out. A new window will pop up with a link called apply for higher quota.
Fill out the form to apply. To my knowledge you do not have to pay for additional YouTube quota but it can take time to get approved. Make sure you comply with everything on the form.
I have never heard of the one project per client term. Technically you can run your application using different API Keys it should work fine. Technically there is nothing wrong with creating additional projects on Google Developer console. You don't need to go as far as creating another Google account.

Is the WebOS calendar api really as limited as it sounds?

A recent Ars Technica article rekindled my interest in WebOS so I was looking at the Services API (because I'm interested in building a replacement calendar app). I discovered the following text at the top of the calendar services API documentation:
Note: To prevent unauthorized use of
private user data, this API provides
access only to records created by your
application; that is, you cannot
access records owned by another
application.
What is the point of even having an API if you can't access data created by other applications? At that point there would be no reason for me to use their API rather than building the data storage myself. Am I missing something? Can any WebOS developers weigh in on this?
P.S. If they named their os "WebOS" you would think they'd know something about sane URLs. Check out that ridiculous calendar api doc url!!
The reason for the limited access is because of security, but not just that. Some services have agreements that limit how their data can be used. For example, having an API that would let a random webOS app access your Facebook calendar data would be working around the FaceBook terms of service that control how that data can be used. The same applies to LinkedIn, Google Calendar, and any other service from which the system is pulling information.
If you just need to post an occasional event, there's a better API to use that lets you cross-launch the calendar app with data that the user can accept into their own calendar. That way, you don't create your own bucket, but the user has to manually accept the event.
The reason to use the calendar APIs is to expose your own data to the user of the device. FlightView, for example, uses it to publish a calendar to the user of upcoming flights that he or she is interested in, and if those get rescheduled, it can automatically change them. The Fandango app uses this to push movie times for theaters the user likes into their calendar view. There's lots of possibilities.

Resources