问题
YouTube v3 api returns significantly different LIKEs count from what is on the web version of YouTube.
Compare these: https://monosnap.com/file/EdtDNTTGDK06zoCZ7IXkMdzn6WuyOo https://monosnap.com/file/CcJOiKl9CBMyncHQSrPv3lkLOuqeDD
To replicate: https://www.googleapis.com/youtube/v3/videos?id=jWnhFM1Ttwg&key={api_key}&maxResults=50&part=statistics (https://console.developers.google.com/apis/credentials - use your Youtube V3 key)
Any ideas?
Many thanks!
回答1:
Since I don't have any documentation (from the YouTube Data API v3) that backs me up for what I going to say, I'll drop some thoughts about why the API returns different values in the "likeCount
" section comparing to the YouTube actual video (saw in the main website):
I think that the differences in the results returned by the API and the results shown in the website are due to:
- YouTube has its own calculations for set the values in the website, the API results and in the YouTube Analytics1.
- It would be possible that those additional "likes" retrieved in the API aren't exposed to the calculations made by YouTube.
1 Extracted from this answer in the Google Support webpage:
- The number of likes/dislikes in YouTube Analytics may be different than what you see on the watch page under the video. This is a known issue and our team is working to fix this. In the meantime, please refer to the counts on the watch page under the video for the most accurate count.
And
- In rare instances, you might see more likes/dislikes than views since these metrics are adjusted by different verification systems.
For the specific videoId
you posted in your question, I did check at 2019-01-25
and the results were:
- likeCount "by the API": 1341
- likeCount "in the YouTube website": 851
Check again at 2019-01-28
the numbers did changed:
- likeCount "by the API": 1367
- likeCount "in the YouTube website": 877
You can try here the API request for get these results - (results for current day).
If you make a substract from the likeCount
values gotten above, you'll get 26
.
Maybe it is futile try make any mathematical operation for set the "correct" value shown in the YouTube website (using the likeCount
result from the YouTube Data API), but if anyone want give it a try, I encourage you to share your answer.
来源:https://stackoverflow.com/questions/54363538/youtube-v3-api-returns-considerably-different-likes-and-comments-results-from-nu