SoundCloud API - Playback Less Than Actual Score

I am using soundcloud api via python SDK.

When I get track data through Search, the track attribute 'playback_count' seems to be less than the actual amount viewed on the Internet.

How can I avoid this problem and get the actual play_count?

(e.g. this playback_count track gives me 2700, but its actually 15k when displayed on the Internet https://soundcloud.com/drumandbassarena/ltj-bukem-soundcrash-mix-march-2016 )

Note: this problem does not occur for comments or comments.

following my code

##Search## tracks = client.get('/tracks', q=querytext, created_at={'from':startdate},duration={'from':startdur},limit=200) outputlist = [] trackinfo = {} resultnum = 0 for t in tracks: trackinfo = {} resultnum += 1 trackinfo["id"] = resultnum trackinfo["title"] =t.title trackinfo["username"]= t.user["username"] trackinfo["created_at"]= t.created_at[:-5] trackinfo["genre"] = t.genre trackinfo["plays"] = t.playback_count trackinfo["comments"] = t.comment_count trackinfo["likes"] =t.likes_count trackinfo["url"] = t.permalink_url outputlist.append(trackinfo) 
+5
source share
2 answers

There is a problem with incorrect display of the playback amount when communicating via the API.

I came across this when I receive data through the / me endpoint for activity and like to mention a couple.

The first image displays the information returned when accessing the sound returned for the currently playing track in the soundcloud widget

Access information via

Information returned via api for the endpoint me / activities

information for the same track through the endpoint / me / activities API for

+3
source

Looking at the SoundCloud website, they actually call the second version of the API to populate the list of tracks on the user's page. This is similar to the documentary version, but not quite the same.

If you run the request https://api-v2.soundcloud.com/stream/users/[userid.BIZ?limit=20&client_id=►clientid] , you will return a JSON object showing the same numbers that you see on the Internet.

Since this is an undocumented version, I am sure that it will change the next time you update your website.

+3
source

Source: https://habr.com/ru/post/1246367/


All Articles