所以我提出了这样的要求: https://www.googleapis.com/youtube/v3/videos?part=statistics&id=Jwb6nrI0zUw&key= {API_key}。
Youtube API v3给了我这个响应:
{
"kind": "youtube#videoListResponse",
"etag": "\"XI7nbFXulYBIpL0ayR_gDh3eu1k/W7u0z0NnBjzYRBgFNlAKCsir4PM\"",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 1
},
"items": [
{
"kind": "youtube#video",
"etag": "\"XI7nbFXulYBIpL0ayR_gDh3eu1k/Xh_JgeXH1BlsD5v6eHIgmsJ5aFQ\"",
"id": "Jwb6nrI0zUw",
"statistics": {
"viewCount": "1724",
"likeCount": "180",
"dislikeCount": "31",
"favoriteCount": "0",
"commentCount": "13"
}
}
]
}
“ likeCount”字段的值为180。
这个数字比视频网页上的数字多20倍:
https://www.youtube.com/watch?v=Jwb6nrI0zUw
为什么会这样想?这是YouTube服务器之间的异步数据吗?
谢谢!