Some way to know about an API Key calls count?
AnsweredHere in our company we're trying to optimize and measure the calls to Podio, not only to make them more efficient for both parts but sometimes for debugging purposes too.
Is there any way to know the calls count for each API Key at the moment? If not, could it be done (something Rest-callable i.e.)?
Thank you.
-
Hi again,
We actually got the rate limits exposed yesterday, but I have been sick and forgot to let you know. You can read a bit here: https://developers.podio.com/index/limits
If you happen to be using the PHP client, pull the latest version and the rate limit info is exposed as:
Podio::rate_limit();
Podio::rate_limit_remaining();These are based off the HTTP response headers so they will vary depending on the exact call you make. I.e. you can use them to see exactly how many more times you can make that same call again.
-
Thank you very much Andreas, and I hope you're feeling better.
Very nice implemented, I was wondering how you guys woud come up with it because if it was some REST resource it would fall into some weird situation where you have to use a call to count calls etc, I guess you guys know more than anyone about it heh.
There's this note "You cannot currently see when your rate limit counter is reset." and that's ok, not much worried about it yet but, can you tell me if all API keys reset at the same time or that depends on its creation time? And if it does, it can vary someway after one's reset timer has started or do you think I could, like, try to "guess" statistically each one's resets and take that as a reliable reference? (Sorry if I didn't make myself clear enough, I can come up with examples if needed).
-
The reset time is actually a bit tricky for us to expose, but we thought it would be better to expose what we could rather than have you wait forever for us to deliver something perfect. :)
The reset time is dependent on the first call you make. You could make qualified guesses based on that or you could use the count and just back off for 10 minutes whenever you hit the limit.
PS. To properly log out of the help center on a shared computer use the logout link in the help center and not the one inside Podio. this will log you out everywhere. :)
-
Hi Steve,
You can read about rate limits and how to request increases at https://developers.podio.com/index/limits
/Andreas
-
never mind - i figured it out.
Here's the ruby-fu:
Podio.connection.get('/org/').env[:response_headers]["x-rate-limit-remaining"]
This gets all orgs (the easiest api call), and pulls out the rate limit remaining from the response headers.
Since this is a non-rate limited call, it will give you a number from 0-5000
If you were to replace ('/org') with a rate-limited call, it will give you 0-250
Please sign in to leave a comment.
Comments
14 comments