I’m working on a Python script. I didn’t have too much trouble getting the ‘access_token’ however, my only concern is how often to update and get the new token? I’m reading that I should wait until the token in near expiration, but is their a standard issue on how much time to set? It’s no problem for me to ask for a new token say every 10 minutes, 60 minutes? I just don’t know how twitch determines the amount of time until a token expires?
My initial json shows 4675259 for expiration in milliseconds, but then a second request shows 4809901; what’s the best way to set my recurring token request?
Alternatively you can just calculate when the token is set to expire based off of the expires_in when you get the token, and then just regularly compare the current time to the expiration time, and that way you wont need to send a request to the Validate Token endpoint.