Exercise: Demo App — Part 3

Learn how to integrate the playlist resources into a real-world app.

We’ve already looked at the playlist and playlistItem resources and how we can use them to retrieve data from the API. In this lesson, we’ll integrate them into the “YouTube Mini” project.

The front end is prebuilt and will be populated with the appropriate data once a successful API request’s response is received.

Explaining the newly created functions

Skeleton code for two new functions, get_playlist_stats on line 1, and get_playlists on line 16, has been provided in the code widget below. The instructions about what to do in each function have been provided in the widget above the function declaration. Just follow the steps to make successful API calls for data retrieval.

In the get_playlists function, we have to set up an API call to retrieve the list of playlists owned by the channel specified by the channelId parameter passed to the function. Once the response is received, it will be filtered and used in the app.

In the get_playlist_stats function, we have to set up an API call to retrieve the list of playlist items in the playlist identified by the playlistId parameter passed to the function.

Get hands-on with 1200+ tech skills courses.