0

I'm trying to get all the members of a SoundCloud group using the Python API.

So far I can get the first 50 but providing the mentioned "linked_partitioning=1" argument doesn't seem to be move on to the next set of members.

My code is:

# Login and authenticate
client = soundcloud.Client(client_id = clientId,
                           client_secret = clientSecret,
                           username = username,
                           password = password)

# print authenticated user's username
print client.get('/me').username

# Get members
count = 1
total = 0;

while count > 0 and total < max:
    members = client.get('/resolve', url=group_url, linked_partitioning=1)

    count = len(members)
    total += count

    # Debug Output
    print "Total: " + str(total) + ". Retrieved another " + str(count) + " members."
    print members[0].username

I've been looking at: https://developers.soundcloud.com/docs/api/guide#pagination but still haven't managed to find a solution.

Community
  • 1
  • 1
Jay
  • 3,373
  • 6
  • 38
  • 55

1 Answers1

0

Snippet of working PHP code using linked_partioning and limit (max value can be 200). The default result set size is 50.

I use the limit with all the endpoints, but have not as yet touched groups, so I can't verify that it works there.

$qryString = self::API_ENDPOINT . self::SEARCH_API_ARTISTS
. "/" . $userId ."/tracks?" . $this->getClientId(true);
$qryString .= "&limit=" . self::MAX_API_PAGE_SIZE;
$qryString .= "&linked_partitioning=1";
SteveE
  • 168
  • 1
  • 6