How to get membership related information by using YoutubeDataAPI - youtube-data-api

I want to use the Youtube API to determine if a video is membership-only or not.
I tried to find out the actual video information using YoutubeAPI's videos, channels, playlists, etc., but it doesn't seem to contain any information related to membership.
Is there any good idea?

One more time YouTube Data API v3 doesn't provide a basic feature.
I would suggest you to use my open-source YouTube operational API, indeed by requesting https://yt.lemnoslife.com/videos?part=isMemberOnly&id=VIDEO_ID you would get a JSON with the boolean value interesting you in item['isMemberOnly'].

Related

How to embed audio in Slack via API?

We want to be able to embed an audio file in a Slack chat via the web API.
So far I managed to files.remote.add but that's just an external link.
Then I tried files.upload and share it to a channel, it does embed and play right inside Slack, but for us it's a suboptimal solution, as users can easily download the file, which is against our requirements.
Is there another way to achieve this?
PS: I've read almost all the documentation, there doesn't seem to be an audio or media block type, although I've seen examples that cite a file block type which is neither documented in the API and it's not defined in Bolt. (at least there are no type definitions for it for typescript)
It's not currently possible to embed a media player (audio or video) via the API. We're constantly tuning our APIs, if you have a specific use case in mind, would you mind writing in to feedback#slack.com and we'll get it logged. Thank you!

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

How to get place description using Google API or any other API?

I am using Google API to get the place information and store it into database. Using Google API I am able to get address, opening hours, rating and reviews as shown in below image.
But, I am not able to get place description which is highlighted in below image in red circle. ("Quaint Italian mainstay for deep-dish, Chicago-style pizza, calzones, pastas & hot dogs.")
I want that information in my application. I think google is taking those information from
Freebase https://developers.google.com/freebase/guide/basic_concepts
Wikipedia https://www.mediawiki.org/wiki/How_to_contribute
But I am not sure.
Can any one help me suggest me that how I can get that information or any other API that I can use to get that information based on google place_id.
Any help would be highly appreciated.
Thank you
Accordingly to the documentation and #xomena, currently you cannot obtain this data via Places API. There is a feature request in Google issue tracker to make the detailed business type available in Places API, however Google doesn't expose any ETA (estimation time of arrival:
https://issuetracker.google.com/issues/35822953
Feel free to star this feature request to express your interest and subscribe to notification from Google.
To my knowledge it is not possible to get this information from the Google Places API. The API documentation does not display the venue description. Try to have a look here: https://developers.google.com/places/web-service/details (it might be that Google does not share all information from their platform with other developers..).
I would suggest you to do one of the following (or perhaps both):
Scrape Google the old school way; i.e. by getting the information from the HTML. There is a quite decent guide for doing that here (you would of course have to adjust the example to scraping Google instead): https://medium.freecodecamp.org/how-to-scrape-websites-with-python-and-beautifulsoup-5946935d93fe.
What I would recommend and which probably is the fastest: enrich your current data with other data. You could e.g. use Foursquare and search for the places you get from Google. It should be possible to get the description for each place on Foursquare. See here: https://developer.foursquare.com/docs/api/venues/details. If you have problems with matching the places after your query has returned, because the venue names are not exactly the same - but close, then you could use an algorithm to match strings that are close; perhaps using the levenstein distance (https://en.wikipedia.org/wiki/Levenshtein_distance).

How to detect restricted youtube videos via the api?

How can I use the youtube api to determine if a video is blocked for students in restricted mode? I have looked through quite a few resources and they all seem like outdated or inaccurate responses. When I go to https://www.googleapis.com/youtube/v3/videos?part=contentDetails&id=IERz1PmkdC4&key={myAPIKey} I get contentDetails but it does not include "contentRating": { "ytRating": "ytAgeRestricted"} even though I know this video is blocked for students in restricted mode.
Is this the wrong api to determine restriction information on a video? Or do I need to be the owner of the video to fetch this info? Or is it no longer possible to get this info via this api?
Currently I have found that I can use a call to https://www.youtube.com/get_video_info?html5=1&video_id=IERz1PmkdC4 when logged in as a student in restricted mode, this will return an error but unrestricted videos will not return an error. But this is an unsupported solution that I would rather avoid.
Resources I have already looked at:
The V3 API documentation - https://developers.google.com/youtube/v3/docs/videos#properties
There is a question here in stack overflow that seems to have an inaccurate response -
Checking if video is age restricted with v3 of YouTube API
An untagged question with no response - http://stackoverflow.hex1.ru/questions/35120259/how-can-i-tell-if-a-youtube-video-cannot-be-viewed-with-restricted-mode-enabled
This didn't help - How do I check if a youtube video is blocked/restricted/deleted

Uploading video to Youtube to a master account

I need to have people sending videos directly to my customer's Youtube account.
My customer doesn't want to have people login with their own Youtube account. This has to be transparent for people so they are not forced to have a Youtube account to send videos.
I found several solutions like Youtube Direct lite or the Youtube Widget but this is not exactly what they need as it force them to log to their own account... Same with Youtube API and OAuth2...
Is there any solution with the YouTube Data API v3 even if this is not really "best practice"
?
(I'm using PHP on Codeigniter)
Best regards.
I've just done a search on Google and found
http://tuts.stackarena.com/2013/03/uploading-videos-to-youtube-from-your-website-in-php/
It may also be worth checking out https://developers.google.com/youtube/ for additional resources, usually you find Google will have a solution for your needs.
Good luck

Resources