Unable to get subscription count using youtube data API v3 - youtube

So I just signed up my app for Youtube Data API V3.. I currently have the API key on hand.
Now.. I don't need to do any auth. I only want to access public information about different youtube channels.. such as their subscriber count, likes/dislikes per video, comments per video.. and that's about it.
Can someone point me to an example of hitting an endpoint to get sub count using a sample youtube account?
Thanks. Any help is appreciated.

Related

Multiple Youtube channels on 1 account. How to restrict provided API key to only 1 channel?

I need the Youtube API key from a client just to populate a link list of their recent videos.
The client expressed they have one account with multiple youtube channels attached to the one google account. For security they are asking if the API can be restricted to one youtube channel. I just fetched the data and displayed it im not a youtube API expert so i am unsure how to direct them. They want the key they provide to only allow data fetched from the specific channel? Is that possible in the API settings when creating the key?
(google search was unhelpful and the docs didnt really mention multiple channels)
Thanks for any insight.
Api keys are only able to access public data. For example public videos uploaded to youtube.
If you want to access private user data then you are going to need to use Oauth2 and authorize the user.
How you authorize the user depends upon which language you are using. You should consult the documentation Authentication
When you authorize a user then will be able to pick which channel to grant you access to. This will give you an access token that you can use to access the data on that channel.

Retrieve channel's info using youtube data API

I want to fetch Youtube channel information e.g. total number of subscribers, language, info tab etc. What's the endpoint to do so if I have only my API key and channel id.
Figured out the answer, following is the API call to fetch channel information.
https://www.googleapis.com/youtube/v3/channels?part=snippet,statistics&id=UCSJ4gkVC6NrvII8umztf0Ow&key=[API_KEY]
Google's API Doc
https://developers.google.com/apis-explorer/#search/youtube.channels.list/m/youtube/v3/youtube.channels.list
using of below link which i shared might be useful for your problem
https://developers.google.com/youtube/v3/docs/channels/list

Get rental price from YouTube Data API

I'm currently using the YouTube Data API v3 for videos and I'd like to get pricing information from the API. I couldn't find anything regarding that in the API. Is there another API for this kind of information that I'm not aware of or some undocumented parameter?
Here's an example request to get information about a movie that can be rented and bought on YouTube:
https://www.googleapis.com/youtube/v3/videos?key=API_KEY_HERE&part=snippet&id=wz43PZMOrAM
There's a price visible on the site itself but no trace of it in the API:
https://www.youtube.com/watch?v=wz43PZMOrAM&app=desktop
Thanks!
This is beyond the Youtube Data API's scope. You can't fetch that information using the Youtube API yet.

Youtube API V3 commentThreads.list method not returning "shared privately" comments

While requesting the list of comment threads for a Youtube video there are certain comments that do not appear on the results:
Comments inside private videos
Comments that were shared privately
I understand this could be a normal response when using a public API Key. But this is happening even if I'm using OAuth 2.0 with an access token belonging to the user and channel owner of the target video.
It's there any workaround for this?
Many thanks in advance for anyone that can shed some light on the matter

How to use the Youtube Analytics API to get the metric "earnings"?

I am a Youtube Partner and I have monetized videos on Youtube. Already receive a small monthly amount through some channels that have associated with my Google Adsense account.
Now, I would like to generate a report gathering the monetary values and views received from each channel.
I did the following question on Google Code, because I thought there was some problem in the API, but it happened that I was using the API incorrectly. See the link below.
http://code.google.com/p/gdata-issues/issues/detail?id=4826#makechanges
Now, I still could not make it work because I do not know where to find the requested data in the response I got from the link above.
Where do I find this CMS_ID? I have more than one channel, so I need to have each accepted as a Youtube Content Manager to use the API and retrieve the gains?
Someone here on Stack Overflow already managed to use the Youtube Analytics API using the metric "earnings"?
My code is in Python based on the example from Google here:
https://developers.google.com/youtube/analytics/v1/code_samples/python
I'm using the following scopes:
YOUTUBE_SCOPES = ["https://www.googleapis.com/auth/youtube.readonly",
"https://www.googleapis.com/auth/yt-analytics.readonly",
"https://www.googleapis.com/auth/youtubepartner",
"https://www.googleapis.com/auth/yt-analytics-monetary.readonly"]
As of right now, it's only possible to retrieve monetary information in YouTube Analytics API reports when those reports are run via the context of a content owner, as described in the documentation.
It is possible to have a monetized channel that is opted in for Google AdSense ads without having that channel managed by a content owner, in which case you would not be able to get those metrics via the YouTube Analytics API.
Let's use the issue you previously opened to track the request to open up this type of report to non-content owners as well, as that's a more appropriate place for feature requests than Stack Overflow.

Resources