How can I use Youtube Analytics API without OAuth? - youtube

I would like to extract youtube channel analytics. Is it possible to extract information like subscriber count over a period of time, number of views over a period of time, region based subscription and so on?

From the documentation:
All YouTube Analytics and YouTube Reporting API requests must be
authorized by the channel or content owner that owns the requested
data.
And the only authentication method mentioned in the docs are the OAuth 2.0 protocol for authorizing access to private user data.

Related

YouTube lifetime token for a server

I'm trying yo create a private application that manages a YouTube account all time, not different ones for clients, only one and the client has access to create a video streaming or other functions with YouTube API v3. Only I found how to the clients logging and manage their accounts but not only one channel all time.
How i can do that?
YouTube lifetime token for a server
What you are refering to is something called service accounts. Its designed for server to server interaction. This type of autohrization is not supported by the YouTube API you need to use Oauth2.
I'm trying yo create a private application that manages a YouTube account all time, not different ones for clients, only one and the client has access to create a video streaming or other functions with YouTube API v3.
You may have some issues here. You will need to create a project on Google developer console for your application and create Oauth2 credetinals.
In order to upload videos that are public your app will need to be verified. Application verification takes time with youtube api. Make sure to apply for it early.
Only I found how to the clients logging and manage their accounts but not only one channel all time.
YouTube authorization is channel based. Your users will need to be authorized for each one of their channels. There is no way to authorize a single user to access all of their channels in one go. It has to be per channel.

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.

Are there fees associated with activating the YouTube Data API?

My client is looking to activate YouTube Data API and is wondering if there are any fees associated with enabling this. Can you please let me know?
YouTube Data API v3 doesn't require to activate billing on your Google account and so no fees are associated with enabling this by default. According to YouTube Data API Overview#quota
Projects that enable the YouTube Data API have a default quota allocation of 10,000 units per day
Note: If you reach the quota limit, you can request additional quota by completing the Quota extension request form for YouTube API Services.

How I retrieve the chanel list using youtube api?

In an youtube account I have more channels.
Exists an api call to retrieve all the channels for my account?
I want to upload videos to different channels in function of some video properties. I think that the problem is that I authorize access to my global account don't give automatic authorization for all channels. I have a refresh-token for offline upload (I use this refresh token to retrieve the token for video upload).
If I retrieve channel list from api, always return only one channel and not all my channels.
You are going to need to authenticate once for each channel. The YouTube API is different then other Google APIs.
Refresh tokens are - project, channel based not project, user based.
So if you have five channels and you want to access them all you will need five refresh tokens one for each channel.

Can Youtube v3 API be used currently for retreiving data of channels that user is not associated with?

I want to know if we can use Youtube V3 API to retrieve channel data, videos etc when the channel requested is not the authenticated user's own channel.
The documentation for v3 youtube api (https://developers.google.com/youtube/v3/docs/channels/list#try-it) says "The list method returns a collection of zero or more channel resources that match the request criteria. At this time, this method does require an authenticated user, and the API only supports requests to retrieve information about the channel that is associated with the currently authenticated user."
Example in V2 it is http://gdata.youtube.com/feeds/api/users/{user_name}, what is the equivalent in v3 ? Is it available yet ?
You can request a channel by ID e.g. Lady Gaga channel:
https://www.googleapis.com/youtube/v3/channels?id=UCNL1ZadSjHpjm4q9j2sVtOA&key=AIzaSyCR5In4DZaTP6IEZQ0r1JceuvluJRzQNLE&part=snippet,contentDetails
The plan is to support retrieving both channel profile information and the ids for the uploads/favorites/playlist/etc. feeds for a given channel in v3. It's not quite yet supported, but should be around the time of the public launch. (Which, I can't commit publicly to a date for that at this time.)

Resources