I am using the following endpoint https://id.twitch.tv/oauth2/token and sending in the required params (grant_type, refresh_token, client_id, and client_secret). Over the last few weeks I have noticed I have been getting a large amount of rate limit exceeded results. I have never had this issue on this endpoint before, did something change? There isn’t a different one that uses the bearer token with a higher rate limit is there?
The one to refresh twitch user access tokens, via their refresh token. I just added some code to my bot to get the headers, but it seemed odd that I just started having this issue recently.
To my knowledge that endpoint shouldn’t/deosnt’ have rate limiting.
So check the
HTTP code
the actual response message
headers
Also note you only need to refresh a user token when you need to use a token, so auto refreshing it on the four hourly~ish schedule might be overkill.
But I suppose it does depend how many user tokens your service is trying to refresh, it should onlty have the broadcasters token for sub read/channel update/etc.
The response status is 429 which is their rate limit exceeded status. I can reply again when I get another failure, but I was also under the impression that this endpoint shouldn’t be behaving like this. I am only worried about the broadcaster tokens, and I have never had this issue in the past refreshing them every 220 minutes. This is something that just recently started happening (and I hadn’t made any code changes). I have under 100 active users right now, so there is no way I should be hitting the 800 limit that exists for other endpoints.
Some more information:
As I said the response code is 429.
The response message is empty (length of 0)
There are no twitch specific headers (limit, remaining, etc).
I am hitting the limit even when no other calls are going out, so I am not really sure what has changed, unless I am sending them out too quickly and something on twitches end is wanting me to slow down (that is the next change I am going to implement).