'YouTube API v3 likes a video, but the counter doesn't increase

Whenever I try to like a video through the YouTube API, it flags the video as liked but the like counter doesn't increase whenever I do. It tells me that I've liked the video, because the like button is fully green, but it doesn't count it as liked?

I'm using this link through CURL with PHP:

https://www.googleapis.com/youtube/v3/videos/rate?access_token=(the token)&id=(video id)&rating=like

I don't get an error if I do this. I don't get any response back, which is correct according to the docs.

Could anyone tell me why the like counter doesn't increase?

EDIT: Dislikes can be added with rating=dislike, but likes won't be added to the counter !



Solution 1:[1]

Easy explanation: Youtube doesn´t count the likes live, as well as the views. They are periodical updated after a certain amount of time. This enables google to analyze the likes / views and filter suspicious actions. Remember the 301-views limit of the videos, a few weeks ago they changed it to display 301+ to indicate that there are more views already, but the count will incrase later on.
So if you wait a few minutes/hours your like should appear, but you cant be sure its really yours since anybody could have liked it too in the meantime ;)

Do you need a more detailed explanation?

Maybe watch this youtube video http://www.youtube.com/watch?v=oIkhgagvrjI to understand that principle.

Solution 2:[2]

Call Below Function u will get an updated LIKE/DISLIKE count

$video_id = "wdZt8vmSRwc";
$api_key= "wdZt8vmSRwcwdZt8vmSRwcwdZt8vmSRwcwdZt8vmSRwc";

For reference I added dummy keys

$JSON = file_get_contents("https://www.googleapis.com/youtube/v3/videos?part=statistics&id=$video_id&key=$api_key");
$json_data = json_decode($JSON, true);
echo $json_data['items'][0]['statistics'];

It will take some time to get like/dislike back in API

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Pylyp Dukhov