Is there a way to get the number off calls a user has left? Going over the limit kinda sucks and locks your key for +/- 5 min...
Api key call limit
Started by Prokrist [585251] on in API Development.
About this thread
Posts archived: 11 / 11 posts (100%) · the total is Torn's reply count + the opening post at the last fetch
Counted by TornLife from the archived posts.
- Archived posts
- 11
- Discussion span
- →
- People posting
- 7
- Likes on archived posts
- 9
- Authority score
- 53 / 100
- Historical score
- 25 / 100
- Story score
- 34 / 100
- Engagement score
- 57 / 100
Most-liked replies
- Plornt [1799359]
· 5 likes ·
I've been thinking whilst this isnt the same as your idea someone trusted should make the following as its clear Torn has no intentions of doing so themselves at the moment: Create a site that takes your API key and …
Is there a way to get the number off calls a user has left? Going over the limit kinda sucks and locks your key for +/- 5 min...
Unfortunately there is no way to get that information.
The only option you have is to use the API responsibly and to keep in mind that the API key is probably being used in other applications too.
Oké, but it sucks that the API key is timed out for 5 min when you go over the limit ... Is there a official way to make this suggestion ? Where they accept/ reject the idea ?
You can use the suggestions forums, but it's a waste of time.
You could develop your own API to estimate Torn API calls left, which you call each time you do a Torn API call, or from sections where you are generating a lot of Torn API calls.
A bit overkill heh, and might not work, but if this is a big problem then I guess it is worth a shot.
You would be rewriting your code to check remaining Torn API calls anyway so refactoring of your previous code is not wasted in case Torn at some point adds such a feature.
I've been thinking whilst this isnt the same as your idea someone trusted should make the following as its clear Torn has no intentions of doing so themselves at the moment:
Create a site that takes your API key and gives you an entirely separate API key (prefixed so detectable by applications) that is essentially a drop in replacement for the current API (ie only thing that changes is the host). This allows the ability to have application specific keys, a count of how many calls is left (providing all applications use this 'wrapper'), permissions etc. You'd be able to log in to the site with your Torn API key and see what calls have been made with your key. It'd be like a security overhaul in that some malicious application cannot use your key for unexpected things.
That's actually a very nice idea and could even take some load off the Torn servers and provide (historical most-recent) data even when the Torn API goes down.
Does the Api go down a lot ?
I am going to post a suggestion.
In the app i am working I added a system that counts the number of calls towards TC, and stops after a certain limit is met. But still this does not prevent going over the limit.
what's the suggestion?
that other people do this too? ...
and no, api doesn't go down a lot :p
The API system has been pretty reliable. But even if your individual program tracks requests, there's no way to track ALL requests, which is the issue.
Not to mention the fact that Torn may adjust the limit at any time with no warning, so there's no way to dynamically change your call rate.
Exactly why some sort of counter should be added to the response..