Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3642

How to get a user's entire YouTube watch history?

$
0
0

I'm trying to get a full list of watched videos for a given user in my YouTube API application. I want to add up total duration of all videos.

When I get the list of videos from history playlist, the API caps it at 50 items. There's pagination but total amount of items is 50 (not just per page); I can't access more data with the API it appears.

Is there any way I can get this playlist without the data cap? I'm hoping for another method (of using the API) or a way to do it without the API. I know YouTube stores this data because I can view my entire history (far more that 50 videos).

I'm using this code:

var requestOptions = {    playlistId: playlistId,    part: 'snippet',    maxResults: 50};gapi.client.youtube.playlistItems.list(requestOptions);

where playlistId is the id of the history playlist I got from a gapi.client.youtube.channels.list request.

Edit (2017): I want to clarify that it was always my intention to download my own history, just out of interest to see how much time I have spent watching videos. I still have not been able to do this.


Viewing all articles
Browse latest Browse all 3642

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>