How Do I Get More Than 5 Videos From A Playlist With Youtubes Api
This gets only 5 videos from my playlist, when there is over 100. $.ajax({ url:'https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&playlistId={MY_PLAYLIST}&am
Solution 1:
Using the available "try-it" functionality in the official documentation (in spanish), I built this URL request for set the maxResults
parameter with the quantity of videos from a given playlist to retrieve.
https://www.googleapis.com/youtube/v3/playlistItems?maxResults=10&part=contentDetails&playlistId=PLZCHH_4VqpRhwzNjMBHJOcfdMhYZzC0K2&key=YOU_API_KEY
In this case, I'm using the playlist called Microsoft HoloLens: Developer Information - this playlist contains 31 videos - (and in the URL request, the maxResults
parameter is set to 10).
The following information was taken from the YouTube Data API - official documentation:
- key: your API key.
- part: The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. For this case, I added
contentDetails
. - playlistId: the Id of the playlist to use in the request.
- maxResults: specifies the maximum number of items that should be returned in the result set. Acceptable values are 0 to 50, inclusive. The default value is 5.
(Link to the official documentation in english can be found here).
Post a Comment for "How Do I Get More Than 5 Videos From A Playlist With Youtubes Api"