Incorporate X-RateLimit-Reset into logic
From Jeff: We just released and tested the solution to this question. So now you’ll never have to guess about the resets. If you look in the response headers now, you’ll see an X-RateLimit-Reset header. The three values in that header are the UNIX Epoch Time at which each of your counters will reset (min./hr./day).
X-RateLimit-Reset: 1573139551/1573140870/1573223670 You can transform the time values to something easier to work with by using these types of statements:
>>> import datetime
>>> datetime.datetime.fromtimestamp(1347517370).strftime('%c')
'2012-09-13 02:22:50'