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.