Skip to content

Scripts to scrape YouTube Channels, Videos and Comments with the Data API.

Notifications You must be signed in to change notification settings

AaronPhilipp/youtube_data_api

Repository files navigation

Tubework Project

cite this repository: DOI

I'm a Research Associate in the DFG-funded project Tubework. There we investigate the YouTuber-scene in the D-A-CH area. To learn more about the project, visit our project website: https://www.uni-potsdam.de/de/sozialstrukturanalyse/index/forschung/tubework

YouTube Data API

We will use the HTTP request method: https://www.w3schools.com/tags/ref_httpmethods.asp

API Reference: https://developers.google.com/youtube/v3/docs

Why using an API?

Through an API we can access informations directly without downloading big datasets and search for the informations we especially need. The API is the interface which allows us to communicate with third-parties.

Understanding YouTube-specific-variables

There are different youtube-specific-variables you should know when working with the API.

channel ID

There are 3 different ways on how your channel URL is built up. Channel Id, Custom Name or Handle. To retrieve informations froma specific channel you should use the unique channel id which consists of numbers and letters and can look like this: UCUZHFZ9jIKrLroW8LcyJEQQ. As you see, the second character of the ID is a 'C'. If you change this to an 'U', you have the Playlist ID for all uploaded videos of the channel.

Google Reference: https://support.google.com/youtube/answer/6180214#

video ID

The video ID will be located at the end of the video URL, right after the v=.

comment ID

When you comment a YouTube Video you get an unique comment ID which looks like this: UgwibHX_mctrwUcNmrl4AaABAg. When you reply to a comment your comment ID is concatenated with the comment ID of the parent (the comment you're replying) and looks like this: UgwibHX_mctrwUcNmrl4AaABAg.9he9SIE3ktd9igqkBpGExC.

About

Scripts to scrape YouTube Channels, Videos and Comments with the Data API.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages