[GH-ISSUE #806] Views from get_song do not match those visible on YouTube Music. #505

Closed
opened 2026-02-27 23:01:10 +03:00 by kerem · 1 comment
Owner

Originally created by @Matp21 on GitHub (Aug 22, 2025).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/806

Hi!
I'm trying to retrieve the music view counter using the get_song() function, but the result I get never matches the counter displayed on YouTube Music, sometimes by a long shot.

For example, I use this code to retrieve the values for this song : https://music.youtube.com/watch?v=M7X8W1HbtRQ&si=3e-jE30n1GGjP3Ff.
The function gives me 53,670,696 views, but on the website it says 539 million views.

`from ytmusicapi import YTMusic, OAuthCredentials
import json

with open("credentials.json",'r') as f :
credentials = json.load(f)
client_id = credentials["installed"]["client_id"]
client_secret = credentials["installed"]["client_secret"]

yt_music = YTMusic("oauth.json", oauth_credentials=OAuthCredentials(client_id=client_id, client_secret=client_secret))

results = yt_music.get_song("M7X8W1HbtRQ")

print(results["videoDetails"]['viewCount'])`

Image

Thanks!

Originally created by @Matp21 on GitHub (Aug 22, 2025). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/806 Hi! I'm trying to retrieve the music view counter using the `get_song()` function, but the result I get never matches the counter displayed on YouTube Music, sometimes by a long shot. For example, I use this code to retrieve the values for this song : https://music.youtube.com/watch?v=M7X8W1HbtRQ&si=3e-jE30n1GGjP3Ff. The function gives me 53,670,696 views, but on the website it says 539 million views. `from ytmusicapi import YTMusic, OAuthCredentials import json with open("credentials.json",'r') as f : credentials = json.load(f) client_id = credentials["installed"]["client_id"] client_secret = credentials["installed"]["client_secret"] yt_music = YTMusic("oauth.json", oauth_credentials=OAuthCredentials(client_id=client_id, client_secret=client_secret)) results = yt_music.get_song("M7X8W1HbtRQ") print(results["videoDetails"]['viewCount'])` <img width="1199" height="66" alt="Image" src="https://github.com/user-attachments/assets/5976b3f5-ce25-4380-99de-f72f234784d1" /> Thanks!
kerem 2026-02-27 23:01:10 +03:00
Author
Owner

@sigma67 commented on GitHub (Aug 30, 2025):

No idea to be honest. Looks like a server-side issue.

You're also comparing two different data sources here. get_song occurs when you press play, what you're showing is the result from get_album (where it should also show 539M with ytmusicapi).

<!-- gh-comment-id:3239500698 --> @sigma67 commented on GitHub (Aug 30, 2025): No idea to be honest. Looks like a server-side issue. You're also comparing two different data sources here. `get_song` occurs when you press play, what you're showing is the result from `get_album` (where it should also show 539M with ytmusicapi).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#505
No description provided.