Skip to content

Instructions: Obtaining an API Key

ThioJoe edited this page Jan 22, 2022 · 2 revisions

Setting Up a Google Cloud Project / Obtaining API Credentials

To use the program, you will need an "Oauth2" credential to access the scanning and deletion functions via YouTube's Data API. Otherwise this script won't work at all.


Steps:

1. Log into Google Developer's Console with your Google account that has your YouTube channel.

2. On the top blue bar nex to where it says "Google Cloud Platform", click the dropdown to 'Select a Project'. (If you have existing projects, it may instead show the name of one)

2

3. In the "Select a Project" Window click "New Project"

3

4. Enter some project name, it doesn't really matter, then click 'Create'

4

5. Make sure the project you just created is active, with it showing at the top, then click "Library" on the left menu.

5

6. Scroll down and click the box that says "YouTube Data API v3"

6

7. Click "Enable" and wait for it to load. It will take you to another page.

7

8. Click "Create Credentials".

(Note: If you don't see this page, open the left pop-out menu and click "APIs & Services" > "Dashboard". Then in the table/list on the page, look in the 'Name' column, and click "YouTube Data API v3")

8

9. In the dropdown, select "YouTube Data API v3", then select "User Data", and click Next

9

10. Under "Oauth Consent Screen", fill out the required fields with some name, select your email, and enter an email below too. It doesn't really matter what you put here. Then click "Save and Continue"

10

11. Click "Add or Remove Scopes", then find the one that says ".../auth/youtube.force-ssl", click the check box, then at the bottom click "Update". Then click "Save and Continue"

11 1 11 2

12. Under "Oauth Client ID", just select 'Desktop App'. You can set a name or not. Then click "create".

12

13. Now click "Download" to download the credentials json file. Rename it to client_secrets.json and save it into the same directory as the python script. Then click done.

13 13 2

14. When trying to log in you may get a "403 Access_Denied" error. If so, you need to add yourself as an authorized user. On the left menu, go to APIs & Services > Oauth Consent Screen > Under Test Users, Click "Add Users". On the pop out window, type in your same Google/channel account email into the box and hit Save.

14

14 2

15. Now you should be able to run the python script, and it will ask you to log in.

Clone this wiki locally