My goal is to be able to get all the statistics in the second API Call for all the videos i've pulled via my first API call.
-My first API Call was this line of code, which worked.
#Make API callpageToken = ""url = "https://www.googleapis.com/youtube/v3/search?key="+API_KEY+"&part=snippet&channelType=any&q=datascience|datascientist&chart=mostPopular&order=viewCount&maxResults=10000"+pageTokenresponse = requests.get(url).json()
-Then i wrote a for loop in order to be able to take the specific attributes that i needed from the call, hence why i used "video_id" in the second call, Hoping it will work.
-Here is the problem, my second call. Here is my code
#2nd API CALLvideo_stats_url = "https://www.googleapis.com/youtube/v3/videos?id="+video_id+"&part=statistics&key="+API_KEYresponse_2 = requests.get(video_stats_url).json()
- Here is the result that i got :
{'kind': 'youtube#videoListResponse','etag': 'SEChKKwRYynfnHVdplNK7DBgSJg','items': [{'kind': 'youtube#video','etag': '5_tBknUTvLB7i91b074xOhccd3U','id': 'pzo13OPXZS4','statistics': {'viewCount': '121146','likeCount': '1939','favoriteCount': '0','commentCount': '49'}}],'pageInfo': {'totalResults': 1, 'resultsPerPage': 1}}
Please help. The goal is to be able to get the statistics of all the videos i pulled in the first API.