I want to get all the videos from a playlist with statistics
data like viewCount
and the videos should be ordered by number of video views. So far I have managed the following:
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId=UUbW18JZRgko_mOGm5er8Yzg&key={YOUR_KEY_HERE}&maxResults=50
In the youtube api v2 we can pass part=statistics
to get the view count but this is not working with v3 playlists. How can I get the above the video data in the above mentioned format.
From the results of playlistItems.list call, collect the video ids, make a comma-separated list and set it as id parameter of videos.list call. That call will give you the data you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With