Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3756

Youtube API in R

$
0
0

i'm trying to get some statistics from a youtube channel. That's my first time, and idk how to do it.

i've created an API Key on cloud.google/etc and do have the channel ID provide by https://yt.lemnoslife.com/channels?handle=@USER. Then, i wrote:

#to call the YT API, i'm using:

api_par <-   paste(paste0("key=", key),         paste0("id=", userID), "part=statistics",        sep = "&")api_call = paste0(base, "channels", "?", api_params)api_results = httr::GET(api_call)json_result = httr::content(api_result, "text", encoding="UTF-8")

#and to save as.dataframe, i'm using

channeljson <- fromJSON(json_result)channeldata <- as.data.frame(channeljson)

but the call has no answer (ie no data is getting saved on channeldata)


Viewing all articles
Browse latest Browse all 3756

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>