4. Search and select the YouTube Data API v.3. Click to enable the API.
5. Go back to the homepage of your project by clicking the Google API logo at the top left. Then, click on the "Credentials" tab on the left side of the page.
6. Click on the blue "create credentials" button then select "API key". This will generate a YouTube API key, which you will need before creating your Oauth 2.0 client ID.
7. Next, click on the blue "create credentials" button again but this time select "OAuth client ID".
8. Complete the application page by selecting "other", adding a name and clicking "Create".
Congrats! You have generated your OAuth 2.0 client ID. You can always see it again by clicking the edit button on the credentials page. Since you are not requesting any user data, you will not need to complete the OAuth consent screen to submit further information to Google.
Now you have the information that you need to start calling the API from your programming language of choice. How do you get started with this?
9. YouTube has extensive documentation on how to pull data using the API along with a code generator to help you along the way. These resources are available for Python, Java and a number of other programming languages. For R users, you can try the tuber package.
In the future, DRI will try to upload sample code from our own analyses to help you get started with this step, so stay tuned!
What data is available?
Before going through all the steps to access YouTube data, what will you actually get?
You can search for collection of videos, channel and playlists that match the query parameters that you specify (e.g. keyword, location, etc). Based on this search, you can get number of metrics. YouTube provides an full description of what's available, here.
In more simple terms, you can get stats on on a specific videos including:
You can also find out more about a specific channel including: