**Everything works in the below function except the :
****comments= video["statistics"]["commentCount"] --> gives keyerror**
def get_video_details(youtube,video_ids ): all_video_stats= [] for i in range(0, len(video_ids), 50): request = youtube.videos().list( part="snippet,contentDetails,statistics", id=",".join(video_ids[i:i+50])) response = request.execute() for video in response["items"]: video_stats= dict(Title= video["snippet"]["title"], Published_date= video["snippet"]["publishedAt"], Views = video["statistics"]["viewCount"], Likes = video["statistics"]["likeCount"], comments= video["statistics"]["commentCount"] ) all_video_stats.append(video_stats) return all_video_statsI tried having a look at Youtube API documentation and got no solution for this!