Skip to content
Bernhard Rieder edited this page Jan 15, 2019 · 10 revisions

YouTube Data Tools

YouTube Data Tools is a collection of simple tools for extracting data from the YouTube platform via the YouTube API v3.

Credits

YTDT is written and maintained by Bernhard Rieder, Associate Professor in Media Studies at the University of Amsterdam and researcher with the Digital Methods Initiative.

Installation

You do not have to install this software to use it. There is a running version here. But if you want your own installation:

  • Go to the Google API Console and create an API key (APIs & auth => credentials => create new key => server key, leave IP list empty).
  • Rename config_sample.php to config.php and paste the API key into the appropriate place.
  • Copy all of the files into folder on your web server (needs to be able to execute PHP) and create a folder called "data" that the script can write to. That's it.

If this does not work, please contact your institution's tech support for help and not the author.

Automatization

For some research projects, it may be interesting to automate requests at regular intervals (check this paper for an example). Two modules can currently be called through the command line (others will follow): video list and video network. If you install YTDT on your server, you can call them like this:

$ php mod_videos_list.php rankby=relevance mode=search iterations=6 query=yourquery filename=yourfilename

$ php mod_videos_net.php rankby=relevance mode=search iterations=2 crawldepth=1 query=yourquery filename=yourfilename

This way, you can call the scripts via normal cron on *nix systems.

Clone this wiki locally