TrackClick SoundCloud API Returns 504
Over the past couple of years, our app has been using the SoundCloud API without any problem. We recently started using 504 errors when trying to request a list of user tracks. Querying the user's metadata is fine, but the tracklist will return 504 about 80% of the time.
Has anyone else experienced this? Any SoundCloud engineer can provide some support?
Example URL: https://api.soundcloud.com/users/1887081/tracks.json?client_id= [OUR_APP_ID]
The docs for this call can be found here: https://developers.soundcloud.com/docs/api/reference#tracks
Sample response for error:
source to share
This user id, 1887081 has 78 tracks. The length of the search query and fetch is clearly longer than their middleware / API expects. I have two recommendations:
-
Write down their support and ask them to optimize their backend or query / index. Instead, they can also increase the timeout.
-
You must use pagination.
limit=10
andoffset=0
to retrieve the first 10.offset=10
to retrieve the next page, etc.
Also, if this is a performance level app at your end, I would recommend using an API monitoring tool like Runscope . You can do automatic scheduled monitoring with simple assertions (no coding) like checking for 200 status or even specific content you know should be present in JSON, etc. This way, when things go south, or performance degrades anyway, you'll know ahead of time instead of figuring it out after your application is interrupted by 403s.
source to share