为什么这个 SoundCloud API 方法不能检索所有曲目?

Why does this SoundCloud API method not retrieve all tracks?

我正在尝试检索所有 my favourited songs from my profile on SoundCloud using the SoundCloud API method /users/{id}/favorites

在 SoundCloud 注册我的应用程序并检索我的 ClientID 后,我可以通过调用 http://api.soundcloud.com/users/goodforenergy/favorites?client_id={my-client-id}.

在 JSON 中成功检索一组收藏曲目

但是,查看我的 SoundCloud 个人资料,您可以看到我(此时此刻)有 182 个赞 - 但该方法只有 returning 48。

关于为什么的任何想法?我认为 JSON 中可能有一个 next_href returned,我应该按照它来检索更多内容,但我没有看到任何内容。无论如何,48 似乎是一个非常随意的数字 return!

根据 soundcloud api docs,API 中的大部分结果都在集合中返回,默认情况下大小限制为 50。我意识到您看到的是 48 而不是50,但可能值得修改您的调用以支持分页。

Most endpoints support a linked_partitioning parameter that will allow you to page through collections. When this parameter is passed, the response will contain a next_href property if there are additional results.

因此您需要更新 API 调用以包含 linked_partitioninglimit 参数,以便接收 next_href.