Exercise 1

If you have not done so before, set up your YouTube API Access in the Google Developer Console and make sure that it’s working. If you already did this before, you can skip this step. If not, you should do it now because we will need API access for the next sections.
Follow the YouTube API Setup tutorial. If you get stuck, feel free to ask us for help.

Exercise 2

Go to the YouTube API console and check the amount of requests you already made for the app you are using.
You can do this by going to the Developer Console and logging in with the Google account you used for creating the app for your API access. On the top left, next to the “Google Cloud Platform” logo, you can click the three lines to open up a menu. In this menu, go to “IAM & Admin” and click in the second to last item in the “IAM & Admin” section, called “Quotas”. Make sure that you have selected the right project.

Exercise 3

Go to the YouTube quota calculator and calculate the resources needed for the following scenarios:

  • search videos with the list method

  • get statistics for videos with the list method

  • get statistics for playlistItems with the list method

You can find the quota calculator here and need to look for the right resource and method. The quota cost of one such call is displayed on the right side.

Exercise 4

Construct and make an API call (either in your console, your browser or in R) to get data with the following parameters:

  • It’s probably helpful to go back to the slide explaining the general structure of API calls.

  • You can look up the names and proper use of different API resources in the documentation on the left side

  • You need to use the PlaylistItem resource, not the Playlists resource

  • You can check out the correct parameter names in the documentation of the resource

You can execute your API call:

  • directly in the console on Linux/Mac using curl

  • from R using the packages curl and jsonlite

  • In your browser by simply inserting the API call into the URL field

Do not forget to authenticate your API request by adding your API key at the end