Closed tzwaeaen closed 5 years ago
Do you have the many 401 with the same user ? And if yes, sometimes it's work ?
Different users, different results. I just tried to grab the season stats for ninja and spammed the command 4 times in a row. This is the result.
Probably the API is not stable ? Strange behavior
@qlaffont it's not that the api is not stable, they added a mechanism that check if you're sending too many requests for more than 14 hours then it automatically respond with unauthorized.
@guyng api limit based on what? because i can definitely say that I haven't sent to many requests. and when exceeding the limit, when I send 4 requests, why do I get 50% results? and why does this only occur on requests for stats for username and not ids?
@eeeAAAkkk nvm, i found the problem. basically, after few hours you need to resend authentication request and get a new valid token and then even after 14 hours your requests will be authorized. My last check i found out that after around 6 hours you need to request for a new token otherwise your requests will partially be unauthorized. and make sure you don't send too many requests.
I think this issue only occurs when you try to lookup stats for a username, id seems to work. I get random 401 unauthorized responses in the lookup() function.
As this is fully random and sometimes works I am not sure what information to provide... :-|