AngelGris
AngelGris

Reputation: 813

SoundCloud /users/{id}/tracks URL not working

We've been using a CURL call on /users/{id}/tracks to get the tracks for a user for a while now, but recently we noticed it stopped working. In fact, when we call the URL in the browser we get a 404 error.

Example URL:

https://api.soundcloud.com/users/lgarciabes/tracks/?client_id={my_id}&format=json

The call to get the tracks in a playlist works fine, but not the one to get all the tracks for the user.

Something changed in the API or is it a bug?

Which URL should we use to get the list of all the tracks for a user?

[UPDATE]

As milleph pointed, using the user ID instead of the permalink name works fine. So the code needs an extra step (getting the ID for a given user name). Letting it get the tracks lists with the permalink was more comfortable and required less cURL calls.

Upvotes: 3

Views: 445

Answers (2)

milleph
milleph

Reputation: 472

Not sure why Soundcloud changed this but replacing username with user id works

https://api.soundcloud.com/users/10827351/tracks/?client_id={my_id}&format=json

Upvotes: 2

DHawthorne
DHawthorne

Reputation: 1

This seems to be a bug unless it is specific to certain CLIENT IDs.

I tried the request in the question's format:

https:// api.soundcloud.com/users/hardwithstyle/tracks/?client_id={my_id}&format=json :: 404 message.

https:// api.soundcloud.com/users/hardwithstyle/playlists/?client_id={my_id}&format=json :: listed the playlists properly.

And the recommended URL format in the answer above, which produced the same results:

https:// api.soundcloud.com/tracks/hardwithstyle?client_id={my_id} :: 404 message.

https:// api.soundcloud.com/playlists/hardwithstyle?client_id={my_id} :: list of playlists.

Upvotes: 0

Related Questions