I'm updating/re-building an simple application for Imgur using their APIs and their python library.
I'm doing my best to implement some rate limiting, to ensure that I remain withing their rate limits. To do so I'm occasionally checking what the remaining quota for the application is at any given time, and reducing options/actions if quota's go below a certain limit. To monitor my quota, I have a simple command that prints my remaining quota:
def printQuota():
client = authAsUser()#check you\'re authorized as a user.
timeTillUserReset = client.credits['UserReset']#Grabs the time the user quota will reset in Unix Epoch
timeString = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(float(timeTillUserReset)))#Formats the Unix Epoch to something readable
print ('User Limit: ' + str(client.credits['UserLimit']))#Print the Total credits that can be allocated.
print ('User Remaining: ' + str(client.credits['UserRemaining']))#Print Total credits available.
print ('User Reset: ' + str(timeString)) #Timestamp for when the credits will be reset.
print ('User Client Limit: ' + str(client.credits['ClientLimit'])) #Total credits that can be allocated for the application in a day.
print ('User Client Remaining: ' + str(client.credits['ClientRemaining'])) #Total credits remaining for the application in a day.
Despite the fact that I make multiple calls with the application, my quota never seems to go down. Very very occasionally, the user quota will dip by a few points, but tends to spring back up again within 30 seconds.
Why does my remaining quota never change? I would expect it to go steadily down over the course of multiple calls, but it almost always returns the following values:
Even if I call it after directly making an API call.