Making with Code

YouTube #

This is a walkthrough to downloading your YouTube watch history.

Downloading Data #

💻 Follow along with this video and the steps below to download your YouTube watch history.

  1. Go to Google Takeout. Make sure you are logged into the Google account you would like to download your Youtube data from.
  2. Select Deselect all. This will ensure you only download your Youtube data, as opposed to all of the data Google assosicates with your account.
  3. Scroll to the bottom and find YouTube and YouTube Music and check the box.
  4. Select Multiple Formats.
    • For History, select HTML and choose JSON. Then, click OK.
  5. Select All Youtube data included
    • Select Deselect all
    • Select history
    • Select OK
  6. Select Next step
  7. Scroll down, select Create export.

This may take awhile. It may only take a few minutes or an hour. You will receive an email when your data is ready for download.

💻 Once your data is ready to download, you'll need to locate the correct file..
  1. Download the first export. You do not need to download all of the exports.
  2. Open the .zip file.
  3. Navigate to the Takeout 6/YouTube and YouTube Music/history folder.
  4. Move the watch_history.json into your desktop/cs9/unit_01 folder.

API Key #

💻 Follow along with this video to get a YouTube API key. You will need this to build out your data file with statistical information.

  1. Go to the Google Cloud Platform Library.
  2. Select isf.edu.hk on the top toolbar on the lefthand side.
  3. Change Project name to ‘cs9 data science’.
  4. Select CREATE. This may take a full minute.
  5. Search for youtube data v3. Select it from the search results.
  6. Select ENABLE. This may take a full minute.
  7. Select Credentials from the left menu.
  8. Select CREATE CREDENTIALS from the top menu.
  9. Select API key from the dropdown menu.
  10. Copy and paste your API key to somewhere you will not lose it..

If you forget your API key, return to this page to access it.