Single youtube API to get total number of videos and and total number of subscribers on my channel - api

I tried Analytics and Reporting APIs separately. And there are questions and answers which deals with them separately. But I want to know is there any single one shot API which gives both? The total number of videos means all the videos irrespective of the playlists. I'm doing this with ReactJS for my own portfolio website.

I did some more research on this. I couldn't find a full fledged api with documentation but you can use this:
https://www.googleapis.com/youtube/v3/channels?part=statistics&id=your-channel-id&key=your-api-key
Make sure you've that api enabled. I'm using Youtube Analytics.

Related

YouTube API - get monthly views from foreign channel

I try finding a way to get the viewcount of the last 6 months of any given YouTube channel. The YouTube analytics API is not helpful, cause it only allows for channels I own - the YouTube data API only returns the total view count of the channel lifetime.
Is there a way I can get the view count a channel has made on a monthly basis via the API? Scraping socialblade is my second option, but I'd rather use the Google Api.
Thanks for your help!
Your going to have to do it like socalblade probably does.
Just scan each channel you want to check every month.
YouTube analytics api only stores data for three months I think and you have to be authorized as you mentioned.
The YouTube data api doesn't store data by date its not intended for analytics.
I set up a system for a client a while back that just poles a few channels every day to get stats for them. Its not optimal but it works.

Loading all YouTube video metadata to an application database

Google YouTube API allows maximum 10,000 units of quota per day. I am trying to avoid 'Quota Exceeded' error as I am making too many calls against the "Search: list" API which costs 100 units of quota per API call.
I read this and several other blogs; and went with my own below analysis.
I am planning to pull data every day once and store it in the database. Can any expert please confirm if below will cover up all the videos under the channel, or I will miss some?
(1) Playlists: list --> Get all the playlists from the channel.
(2) PlaylistItems: list --> Iterate over each playlist one by one, and get all videos in it.
To answer your comment #Test:
I want to ask whether if i loop all playlists, will it give ma all the videos under channel id or not.
If by all playlists you mean all playlists intentionally created by the given YouTube channel then it depends whether or not he selected all his videos.
I would recommend you to use this approach to retrieve all YouTube videos of a given YouTube channel which seems to be your case. The approach consists in getting the uploads auto-created playlist id of the YouTube channel by using Channels: list with contentDetails in part and then use PlaylistItems: list to retrieve all public videos uploaded on this YouTube channel. Using this method you will retrieve all public YouTube videos as long as the studied YouTube channel has less than 20 000 YouTube public videos. In this last case use this script which softwarly fake an automatic browse in the Videos tab of the given YouTube channel.

Forgotify vs track play count in Spotify API

There's lots of buzz about Forgotify (http://forgotify.com) - a tool, that crawls Spotify against unplayed tracks.
Non-technical press articles say that they use Spotify API to crawl the songs and index only those with zero play count.
However, according to Spotify API documentation, such value is not available for single tracks:
https://developer.spotify.com/docs/apps/api/1.0/api-models-track.html
Similar question about possibility to retrieve track play count has also been answered here on StackOverflow (Get play count of a track from Spotify API) with similar results - that it's not possible.
I'm looking for a clue how Forgotify achieved what they claim they did. Any ideas? :)
The metadata api and libspotify provide the popularity score for songs. Perhaps they searched for tracks with popularity of zero. I don't know that zero popularity implies zero plays though.
They also could have implemented a remote control of the desktop client with some screen scraping. Or reverse engineered whatever internal communication the desktop does (though I suspect Spotify would have put a stop to that).

Can I use the Spotify recommendation intelligence in an app?

On the Spotify dashboard an user has a great experience through the recommended artist and songs. I would like to use this intelligence in an app we plan to develop for a big Dutch based podium. So the app can give a list of concerts playing at the poppodium which the user might be interested in.
Can I get this recommended artist data, based on the user's history, through the Spotify API?
The Spotify API now provides recommendations:
https://developer.spotify.com/web-api/get-recommendations/
Recommendations are generated based on the available information for a
given seed entity and matched against similar artists and tracks. If
there is sufficient information about the provided seeds, a list of
tracks will be returned together with pool size details.
For artists and tracks that are very new or obscure there might not be
enough data to generate a list of tracks.
There are a bunch of parameters that can be configured for fine-tuning the recommendation: key, genre, loudness, energy, instrumentalness, popularity, speechiness, danceability, key ...
You can use Spotify's Web API endpoints to fetch these data:
The Get a User’s Top Artists and Tracks endpoint will give you artists and tracks based on user's listening history. You can also use the Get Current User’s Recently Played Tracks, which will give you up to 50 recently played tracks.
Use the artists and tracks you just get and use them as seeds for the Get Recommendations Based on Seeds endpoint. This endpoint will only return tracks. If you want to get artists based on other artists there is the Get an Artist’s Related Artists endpoint that you can use.
As you see, combining multiple endpoints will get you covered. Just make sure you read the Web API Authorization Guide before. You are going to need the user to authenticate in order to get user's data.
Note: When the question was first posted (July 2013), Spotify's Web API didn't exist. The question referred to a now defunct Spotify Apps API which didn't provide a way to generate recommendations based on listening history.

Can I retrieve Youtube playlist views through the Youtube API?

I asked in this question how to see how many views a Youtube playlist has. Unfortunately, it has been removed from the UI. Can I retrieve Youtube playlist views through the Youtube API?
For now, I think, there is no way to get round it in API requests. According to YouTube's Playlist Documentation, it does not provide a statistics parameter which is responsible for providing various stats about videos. I was also looking for a similar use case and I came across this question. Maybe someone else can find a (hackable-)way along the way.