Only 50 SoundCloud groups returned by GET

狂风中的少年 提交于 2020-01-02 05:41:13

问题


I have joined 92 groups in SoundCloud, but when I do an SC.get("/me/groups"....etc I only get 50 returned to me. When I do a

curl http://api.soundcloud.com/users/6999000/groups.json?client_id=MY_CLIENT_ID

I only get 50 results returned to me? Any way to get the full number of group entries returned?


回答1:


There is an offset GET parameter that you can pass in order to retrieve tracks above the 50 items limit.

curl http://api.soundcloud.com/users/6999000/groups.json?client_id=YOUR_CLIENT_ID&offset=50

I hope this helps.




回答2:


You can use a loop and offset to get all.

Pseudo code...

String url = "http://api.soundcloud.com/users/6999000/groups.json?client_id=MY_CLIENT_ID";
getGroups(url);

int count = 50;
String newUrl = "http://api.soundcloud.com/users/6999000/groups.json?client_id=MY_CLIENT_ID&offset=50";
while( count < 92) {
    getGroups(newUrl);
    count = count + 50;
    }

Look at http://developers.soundcloud.com/docs#pagination for more information on offsets.



来源:https://stackoverflow.com/questions/14212073/only-50-soundcloud-groups-returned-by-get

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!