0

I want to get the likecount and view count for a particular video through Youtube Python API, but I am running into some error.

So, I decided to use the Youtube API - try now feature, and even that seems to fail.

I get the following response:

{
 "kind": "youtube#videoListResponse",
 "etag": "\"oyKLwABI4napfYXnGO8jtXfIsfc/ov4vQrHRyCqPDg7Vz5rYnV_kqX0\"",
 "pageInfo": {
  "totalResults": 1,
  "resultsPerPage": 1
 },
 "items": [
  {

   "kind": "youtube#video",
   "etag": "\"oyKLwABI4napfYXnGO8jtXfIsfc/3mmz358ZOYsLZ4S2f0zLLzHJl1A\"",
   "id": "j2e2rqczk2U",
   "contentDetails": {
    "duration": "PT2H8M34S",
    "dimension": "2d",
    "definition": "sd",
    "caption": "false",
    "licensedContent": true
   },
   "status": {
    "uploadStatus": "processed",
    "privacyStatus": "public",
    "license": "youtube",
    "embeddable": true,
    "publicStatsViewable": true
   },
   "statistics": {
    "viewCount": "212821",
    "favoriteCount": "0",
    "commentCount": "31"
   }
  }
 ]
}

According to the API documentation:

status.publicStatsViewable boolean This value indicates whether the extended video statistics on the video's watch page are publicly viewable. By default, those statistics are viewable, and statistics like a video's viewcount and ratings will still be publicly visible even if this property's value is set to false.

This variable is true in the above response. However, likeCount is still missing.

What am I doing incorrectly? When I open the video on youtube, I do see likeCount.

Manas Paldhe
  • 766
  • 1
  • 10
  • 32

1 Answers1

0

I asked a similar question one week ago and the Google-API seems to be very restrictive. You can only get the likecount and viewcount if you are the owner of the video.

So as you already said, those information are sadly not in the response. Rather then spending to much on the api, i just did a simple parsing of the youtbe link.

Here ist the Solution:

How to retrieve like/dislike/view count from Youtube?

Community
  • 1
  • 1
user1767754
  • 23,311
  • 18
  • 141
  • 164
  • Nope, not true. For a huge set of video which I do not own, I do get the information. video id = CBYhVcO4WgI is an example – Manas Paldhe Oct 13 '15 at 20:17
  • do you get view count? and like count? – user1767754 Oct 13 '15 at 20:25
  • Yes. "statistics": { "viewCount": "444656", "likeCount": "3145", "dislikeCount": "87", "favoriteCount": "0", "commentCount": "247" } – Manas Paldhe Oct 13 '15 at 20:29
  • And what were you doing wrong when you were asking this question? – user1767754 Oct 13 '15 at 22:51
  • I think I did not explain clearly. The bug still exists. For video: CBYhVcO4WgI - there is no bug - I get likeCount etc as in my second (overall third) comment. For video: j2e2rqczk2U - there IS a bug - I am not getting likeCount in the response. I do not own either of the two videos. The rest of the response, including value of "publicStatsViewable" is same (true). So why should this happen? – Manas Paldhe Oct 14 '15 at 01:37