How to return subscribers in order (Helix API)


#1

I am currently in the process of migrating the Subscribers endpoint V3 (kraken) to the new Helix endpoint.
Old Kraken endpoint: https://dev.twitch.tv/docs/v5/reference/channels#get-channel-subscribers
New Helix endpoint: https://dev.twitch.tv/docs/api/reference#get-broadcaster-subscriptions

I am noticing several differences / missing information in the newer version and I am looking for some guidance.

1.Using the new Helix API, how can I return subscribers in the order they have subscribed?
The old version of the subscribers endpoint had a ?direction=asc|desc query string parameter, allowing you to get the results back in ascending/descending order. The new version does not have this query string parameter and appears to return results back in a random order.

I’ve found that the Helix endpoint does seem to support using the parameter ?first=#, however this also returns the results in a random order. If you pass in ?first=1 this is the only time it will consistently return the most recent subscriber.

2. Using the new Helix API, how do I get the total number of subscribers?
The old endpoint returned a _total value in the response.
The new endpoint just returns the array in pages of 100 with a pagination cursor.

Is it expected that we hit this endpoint multiple times with the cursor and add them up on our own?


#2
  1. Currently you don’t
  2. You iterate all pages and math it yourself

Helix doesn’t present this data. And we are not sure if it will.


#3

Migrate to V5 doesn’t mean stop using kraken.

you can keep using kraken just add a new header Accept: application/vnd.twitchtv.v5+json

and is advised to add “api_version=5” to yours link see here why