In the past few days, I’ve been working on retrieving data from various Google Products with their APIs, I figured it would be helpful (at least for myself!) to write a few short tutorials about them.
For a start, I would do it for Youtube Analytics API since it seems to be commonly used these days.
Prerequisites: You will need python 2.7 and a few libraries:
Authentication and Details: Below are a few steps you need to do beforehands:
- Create new Google project at google’s developers console
- Enable Youtube APIs at the
APIs & auth > APIstab:
- Generate your OAuth’s
client_secret.jsoncredentials at the
APIs & auth > Credentialstab:
Download JSON after done)
- Get your
channel_idof choice at your Youtube’s dashboard (
content_owner_idwill be displayed in the url - in this case:
Firing your first ever API call (and also, generate your
oauth2 credential file i.e
- In other to do this, we will use my version of Youtube API Sample file:
It’s also adviseable that you have a look at Youtube Channel Reports API Page or Youtube Content Owner Reports API Page for the list of
Filtersto be used in your own reports.