-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get tracks endpoint supports only single id now we can not pass multiple ids #286
Comments
Seems to be the input is should be single If you want tracks from a specific |
No, but I want song details by passing specific IDs, like earlier. so that I can get specific song details in a single call. |
Earlier, it supported multiple song IDs. Please help me with this. I don't GET /users/{user_id}/tracks like this because it gives multiple IDs of users that are in the playlist. i don't want this. |
The GET /tracks/{track_id} is supposed to only return the track that you requested with the id, the seen behaviour is correct. |
@MariaVWSoundCloud but i don't want tracks of users; i want specific tracks without respect to user tracks |
You can't do that with a single call. Just make multiple of those calls with the set of IDs. |
@adithayyil This will increase my number of API calls and delay my response as well. and there is a limit of 15k requests, so few users themselves do that many requests in a day. The old API response and request parameters were really useful. |
The rate limit only affects playback requests. |
@obrhoff Thanks for the clarification, but what about the main issue, i.e. delay? suppose i want to fetch 15-20 IDs In that case, it will get details one by one, which definitely take more time and user will get frustrated |
A discussion on rate limits: https://github.com/soundcloud/api/discussions/225#discussioncomment-3604831 For your specific issue, you aren't looking at the right API endpoint. As with most RESTful API designs, Therefore, you should be looking at the So to take this one step further, your request will look like this:
To head off your next question before you ask it, I believe the limit is 50 IDs in one request, but feel free to find out for yourself! |
@mgoodfellow I already explored all the possible ways, so I raised a request.
|
This is the search tracks endpoint.
There is no search/tracks endpoint, its just /tracks q is not required, you can simply pass:
And receive a valid result:
Without linked partitioning, you will just receive an array back. In theory, providing no additional search params, means that you would be filtering the entire unrestricted data set for specific IDs, which is what you want. However, when all this is said and done, you are correct, there does seem to be a breakage. Other parameters work, such as I wonder if it is related to: #249 ? I haven't used this /tracks?ids=1,2,3,4 form in a while. |
https://api.soundcloud.com/tracks?linked_partitioning=true this will return tracks which we don't want, As seen in the screenshot, i want two specific tracks How do I get that? if i add ids it is returning [] |
No, I'm agreeing with you. It appears there is a breakage on this endpoint, and I linked the other issue raised regarding odd behaviour on this endpoint and I wonder if it is all related? Most combinations of params work, but if you provide ids then you get back []. Very strange. Sadly this doesn't give you many options to work with, other than parallelising your requests when you want a set of tracks to reduce the delay to the user as you mentioned before. |
Hi, Ok ready to go down the rabbit hole? There are 10 IDs in this list, (they are all my tracks), and it returns.... 9 tracks! The last ID is missing (32422529). Any less than 10 IDs in the request will return an empty array. Ok, so let's add an 11th ID, 36623550: Now we have got back 10 tracks, but the same ID as before, 32422529, is still missing now in this request. I cannot tell you why this track is always missing from the collection, but it is. So what I have got for you so far:
Still, food for thought! Hope this helps in some manner. |
@mgoodfellow This will return the same tracks every time, no matter what IDs you are passing. i am waiting for @MariaVWSoundCloud SoundCloud team has any correct way to do this. As per new api update, the GET /tracks/{track_id} is supposed to only return the track that you requested with the single id The GET /users/{user_id}/tracks will return all tracks of a user. but there is no API that returns specific tracks using multiple IDs. So wait until the team doesn't give confirmation on this. |
@tinyscratch It is returning IDs from the request:
65551594 is one of the tracks provided. I just matched them all up and they are as expected, except that one track is missing. So I requested 10 IDs, and received 9. All 9 of the tracks I did receive back were in the ID list I provided |
But the most interesting and bizarre thing is that requesting < 10 IDs will always return an empty array. It definitely seems like there is a bug somewhere when the request is being handled. This format, |
@mgoodfellow You are not sending a request correctly; it should be like this: /tracks/1 type int. This is as per the new requirement of the API, and if you will send /tracks?id=1,2,3,4,5 you will not get correct result |
I'm happy to leave this thread and let you get on then - I've provided a whole raft of interesting proofs around strange behaviour on the search endpoint where it is almost behaving as expected. It is also the correct way, as documented, to receive/read a collection of tracks. This is the normal approach with APIs. Sadly it seems there is an issue with the I'm not talking about Did you run the requests I provided? No? Never mind then, I found it interesting to dig in and discover this strange behaviour around the Don't really appreciate being told I'm not sending requests correctly, I do not find that constructive. I'm sorry that all this research I have laid out for you clearly as I can is apparently of zero value to you. I'm not sure why you keep talking about the "new" requirements of the API. I've been using it for years and the specification has not changed. Have a great day. |
@mgoodfellow Thank you for your efforts in exploring and providing detailed information about the issue that I have raised. I am using this: https://api.soundcloud.com/tracks?ids=193242539,69987839,77720379 in the same way that you mention, and it was working for me. I have been using this for a long time, but there is an update to this API, so it is not working. That is what I am trying to say, or I might be wrong. |
Just tell me, Ex: how to get this four-tracks [193242539,69987839,77720379] In a single call, I cannot do this in a loop because if the IDs are more, then it will take time. |
This not an Soundcloud Issue. @tinyscratch Solution: Please close the issue after it worked. |
Title: Cannot retrieve all tracks using ids to get multiple track at same time
Issue found on : September 27th, 2020
Endpoint(s):
GET /tracks/{track_id}
The text was updated successfully, but these errors were encountered: