Purpose

Using the “tuber” package to help analyze youtube videos comments and pull youtube analytics reports from youtube videos and channels. This service is important to Youtubers as it is useful in understanding how Youtube content is doing. One can pull viewers’ comments, video metrics such as number of views,number of shares, revenue per video, likes, comments,etc. This information is useful in marketing and figuring out the right content for viewers.

HOW IT WORKS USING THE “TUBER” PACKAGE

Setting it up in Google

Go to Google API’s Console. Then click on select project/create project. Click on Library and in the list of API’s select “Youtube Analytics API” and enable. Add credentials to the project and follow instructions to create an API key. Create OAuth Client ID and client secret.

Setting it up in R

Download/copy the client ID and secret you created. IN R Studio, set up code as shown below;

app_id <- Paste the link to the client Id app_secret<- paste client secret link created yt_auth(app_id, app_secret, token=’’) Write commands from the “tuber” package to pull the data you are interested in such as comments, shares.

Getting youtube channel statistics using the get_stats command in tuber

## Channel Title: API YT 
## No. of Views: 0 
## No. of Subscribers: 0 
## No. of Videos: 0
## $kind
## [1] "youtube#channel"
## 
## $etag
## [1] "\"p4VTdlkQv3HQeTEaXgvLePAydmU/kBuqzyv4AwocuF2uJV4tq_orLKs\""
## 
## $id
## [1] "UCMbozN0ecwd4IwlJRPm6A5A"
## 
## $snippet
## $snippet$title
## [1] "API YT"
## 
## $snippet$description
## [1] ""
## 
## $snippet$publishedAt
## [1] "2014-07-19T17:12:53.000Z"
## 
## $snippet$thumbnails
## $snippet$thumbnails$default
## $snippet$thumbnails$default$url
## [1] "https://yt3.ggpht.com/a/AGF-l787MJ-AEjsmVdebATIKi-7rN8h9EuzarAXV=s88-c-k-c0xffffffff-no-rj-mo"
## 
## $snippet$thumbnails$default$width
## [1] 88
## 
## $snippet$thumbnails$default$height
## [1] 88
## 
## 
## $snippet$thumbnails$medium
## $snippet$thumbnails$medium$url
## [1] "https://yt3.ggpht.com/a/AGF-l787MJ-AEjsmVdebATIKi-7rN8h9EuzarAXV=s240-c-k-c0xffffffff-no-rj-mo"
## 
## $snippet$thumbnails$medium$width
## [1] 240
## 
## $snippet$thumbnails$medium$height
## [1] 240
## 
## 
## $snippet$thumbnails$high
## $snippet$thumbnails$high$url
## [1] "https://yt3.ggpht.com/a/AGF-l787MJ-AEjsmVdebATIKi-7rN8h9EuzarAXV=s800-c-k-c0xffffffff-no-rj-mo"
## 
## $snippet$thumbnails$high$width
## [1] 800
## 
## $snippet$thumbnails$high$height
## [1] 800
## 
## 
## 
## $snippet$localized
## $snippet$localized$title
## [1] "API YT"
## 
## $snippet$localized$description
## [1] ""
## 
## 
## 
## $statistics
## $statistics$viewCount
## [1] "0"
## 
## $statistics$commentCount
## [1] "0"
## 
## $statistics$subscriberCount
## [1] "0"
## 
## $statistics$hiddenSubscriberCount
## [1] FALSE
## 
## $statistics$videoCount
## [1] "0"