1
votes

I need to get whole user's tracklist by SC api. Before I use the next link format:

https://api.soundcloud.com/users/{user_id}/tracks/?page_size=200&linked_partitioning=1&client_id={app_id}

But it has stopped to work correct recently. Changes:

  • limit has been decreased by SC from 200 tracks to 50;
  • returned tracks have become random (eg user has 300 tracks, but request above returns 54 tracks and link to the next page of tracks where fields "offset=50&limit=50" are appearing; when I change field "page_size" from 200 to 50, SC returns only 18 tracks).

Also I've tried to use fields "offset" and "limit" instead of "page_size" but it has worked incorrect, too.

How I can get whole user's tracklist?

2

2 Answers

0
votes

You need to parse the response and read next_href then change the url to the next_href value.
It's better to do this as a loop until there is no more next_href

0
votes

Some recent updates on pagination from the API can be found below. You need to rely on the cursor rather than offset

https://developers.soundcloud.com/blog/pagination-updates-on-our-api