Closed mikechambers closed 1 year ago
@mikechambers - thanks for filing this! We're taking a look at it in ticket VXL-1637, however in the meantime the other sorts beyond created_at (the default) will work with the offset normally.
thanks for filing this! We're taking a look at it in ticket VXL-1637, however in the meantime the other sorts beyond created_at (the default) will work with the offset normally.
@lleadbet Thank you. Can confirm that works:
Worth noting that kraken/channels/<ID>/follows
is also affected by this, and since it doesn't have a sortby
parameter, possibly has no workaround.
Yep, broken and offset
gets ignored. The lack of responses on this issue tracker from the responsible Twitch devs is concerning, even if v5 is deprecated. This is at least the third or fourth pagination issues I've encountered over the past year.
Example (without posting explicit user and channel IDs):
$ curl -s \
-H "Accept: application/vnd.twitchtv.v5+json" \
-H "Client-ID: CLIENT_ID" \
-H "Authorization: OAuth TOKEN" \
"https://api.twitch.tv/kraken/users/USER_ID/follows/channels" \
| jq '._total'
140
$ curl -s \
-H "Accept: application/vnd.twitchtv.v5+json" \
-H "Client-ID: CLIENT_ID" \
-H "Authorization: OAuth TOKEN" \
"https://api.twitch.tv/kraken/users/USER_ID/follows/channels?limit=5&offset=0" \
| jq '.follows[].created_at'
"2020-12-03T00:36:57Z"
"2020-09-07T20:19:11Z"
"2020-06-25T20:50:17Z"
"2020-05-24T17:53:24Z"
"2020-03-29T15:09:01Z"
$ curl -s \
-H "Accept: application/vnd.twitchtv.v5+json" \
-H "Client-ID: CLIENT_ID" \
-H "Authorization: OAuth TOKEN" \
"https://api.twitch.tv/kraken/users/USER_ID/follows/channels?limit=5&offset=5" \
| jq '.follows[].created_at'
"2020-12-03T00:36:57Z"
"2020-09-07T20:19:11Z"
"2020-06-25T20:50:17Z"
"2020-05-24T17:53:24Z"
"2020-03-29T15:09:01Z"
@d-fischer @bastimeyer - Apologies for radio silence here. The team is still digging into the above ticket, however we wanted to provide a couple updates on the channels/:channel_id/follows
endpoint.
As noted above, the offset parameter is no longer working, and we're planning to deprecate it as a result. In its place, you can use the cursor
parameter along with the _cursor
attribute in the response to get the remaining results.
If you have issues with that, please tag me directly and I'll have the team triage quickly.
Additionally- @bastimeyer, if you have specific pagination issues you're noting, please feel free to let me know and I'm happy to dig. You can ping me on Discord in the TwitchDev Discord as @ConcreteEntree.
Again- sincere apologies here.
@lleadbet For the original bug, the workaround was to use a sort other than the default (created_at), which then works correctly. Will this still work?
@mikechambers - For the users endpoint, that's correct. The above only applies to the channel follows endpoint in v5.
@lleadbet
As noted above, the offset parameter is no longer working, and we're planning to deprecate it as a result. In its place, you can use the
cursor
parameter along with the_cursor
attribute in the response to get the remaining results.
There is no _cursor
field in the JSON response, so your proposed workaround is not working.
Could we please get a response from one of the responsible Twitch API devs?
As I've already said a month ago, the API on the /kraken/users/ID/follows/channels
endpoint doesn't return the _cursor
field, so it's impossible to use the cursor
query parameter here.
And the documented offset
parameter is still broken.
This needs to be fixed.
no _cursor
field in the JSON response
curl -s \
-H "Accept: application/vnd.twitchtv.v5+json" \
-H "Client-ID: MY_CLIENT_ID" \
-H "Authorization: OAuth MY_OAUTH_TOKEN" \
"https://api.twitch.tv/kraken/users/MY_USER_ID/follows/channels?limit=1" \
| jq
{
"_total": 138,
"follows": [
{...}
]
}
offset
still broken
curl -s \
-H "Accept: application/vnd.twitchtv.v5+json" \
-H "Client-ID: MY_CLIENT_ID" \
-H "Authorization: OAuth MY_OAUTH_TOKEN" \
"https://api.twitch.tv/kraken/users/MY_USER_ID/follows/channels?limit=1" \
| jq -r '.follows[0].channel._id'
419330868
curl -s \
-H "Accept: application/vnd.twitchtv.v5+json" \
-H "Client-ID: MY_CLIENT_ID" \
-H "Authorization: OAuth MY_OAUTH_TOKEN" \
"https://api.twitch.tv/kraken/users/MY_USER_ID/follows/channels?limit=1&offset=1" \
| jq -r '.follows[0].channel._id'
419330868
curl -s \
-H "Accept: application/vnd.twitchtv.v5+json" \
-H "Client-ID: MY_CLIENT_ID" \
-H "Authorization: OAuth MY_OAUTH_TOKEN" \
"https://api.twitch.tv/kraken/users/MY_USER_ID/follows/channels?limit=1&offset=2" \
| jq -r '.follows[0].channel._id'
419330868
It's annoying that this bug is still alive for more than a half of year, but work-around with sortby=login
actually works.
Closing due to the deprecation of the Kraken API as of February 2023.
Brief description
When using: https://dev.twitch.tv/docs/v5/reference/users#get-user-follows
The offset value is being ignored, making it impossible to load all data (above 100).
Example call: https://api.twitch.tv/kraken/users/43091333/follows/channels?limit=100&offset=0
Returns first 100 items, with a _total of 382.
If you then increment the offset: https://api.twitch.tv/kraken/users/43091333/follows/channels?limit=100&offset=100
The same data set is returned.
I started getting reports about this about two days ago, and it appears to only impact some users. In my case, I was not using Oauth for authentication, but rather passing in user id via URL and setting the Accept header : application/vnd.twitchtv.v5+json.
There are a number of other reports on the Twitch Developer discord, included below:
How to reproduce
Expected behavior
Offset value increments data being returned
Screenshots
Additional context or questions