My API key is constantly disabled with "too many requests" being listed as the reason way. I am trying to make roughly ~13 API calls/minute so I should not be getting locked out as far as I know. What is going on?
API Key
Started by Xanet [2007324] on in Bugs & Issues.
About this thread
Posts archived: 13 / 13 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
- 13
- Discussion span
- →
- People posting
- 6
- Likes on archived posts
- 1
- Posts by staff, officers and moderators
- 4
- Authority score
- 60 / 100
- Historical score
- 39 / 100
- Story score
- 40 / 100
- Engagement score
- 55 / 100
The limit is 100 requests per minute across all your keys. If your keys are getting disabled, it means that you are crossing this limit, it would not limit it for just 13 requests per minute. Please note that the usage limit is across all of your keys, so if you have 5 keys making 13 requests per minute, you are already at 65 total requests per minute.
When the API key gets disabled, you can take a look at the recent usage history to find out if there are some other places that you have entered the key that is using up the limits. If you are using other tools/extensions, they also make requests using your API key.
[image: i.imgur.com]
If you are still unable to figure out what's going on. I'd recommend you to delete and make new keys and use it only for your specific purpose and see if it is still breaching the limit.
Thanks!
When the API key gets disabled, you can take a look at the recent usage history to find out if there are some other places that you have entered the key that is using up the limits. If you are using other tools/extensions, they also make requests using your API key.
[image: i.imgur.com]
If you are still unable to figure out what's going on. I'd recommend you to delete and make new keys and use it only for your specific purpose and see if it is still breaching the limit.
Thanks!
I had this same problem. Everything stopped working for me. I wasn't able to use any scripts, despite the fact that there were not that many requests. It seems to have fixed itself now.
Hi,
I am aware multiple API keys all add to the request limitation, however I only have one key being called. According to everything I can see (I checked both recent history on the API key and the thing making the API calls) I am making between 10 and 15 a minute. I am in no way coming close to exceeding the limit. Please the image below that clearly shows I made 2 measly API calls the one minute. And only 4 the following. My key is still disabled.
[image: i.imgur.com]
I am aware multiple API keys all add to the request limitation, however I only have one key being called. According to everything I can see (I checked both recent history on the API key and the thing making the API calls) I am making between 10 and 15 a minute. I am in no way coming close to exceeding the limit. Please the image below that clearly shows I made 2 measly API calls the one minute. And only 4 the following. My key is still disabled.
[image: i.imgur.com]
Stop everything you’re running and then try again.
Alternatively reset all of your keys and then add them one by one back in and see when you get rate limited.
Now that I think about it, it may be worth adding a “Calls per minute” counter to the api page to see what key is being used the most.
Alternatively reset all of your keys and then add them one by one back in and see when you get rate limited.
Now that I think about it, it may be worth adding a “Calls per minute” counter to the api page to see what key is being used the most.
Did that, I know what is causing the problem, but as shown above it is not making anywhere near 100 calls/min. I would like to know why it's still blocked.
Passing along to Joe for checking.
I will note it appears that OCCASIONALLY the calls go through, but not with any consistency
Have you checked the history list of all of your API keys WHILE you're blocked?
I just don't understand what could be causing this for you.
It should be simple, you're making 100 calls per minute to the API, resulting in a short block. Something must be making those calls, and it must be showing them in your history somewhere.
I just don't understand what could be causing this for you.
It should be simple, you're making 100 calls per minute to the API, resulting in a short block. Something must be making those calls, and it must be showing them in your history somewhere.
Hi,
I checked my API keys only one has any calls being made on it. I deleted that key to make there weren't any unauthorized calls being made, and made a new key. I put this key back in my script, which as far as I can tell (from my history and the logs of the script) doesn't top 20 calls a minute ever. Is there a way to check my history beyond the last like 10 calls I can see on recent history?
Edit: I just went and looked and saw my key had been idle for ten minutes and went and manually tried to make a call on the tornapi webpage, and still too many requests
I checked my API keys only one has any calls being made on it. I deleted that key to make there weren't any unauthorized calls being made, and made a new key. I put this key back in my script, which as far as I can tell (from my history and the logs of the script) doesn't top 20 calls a minute ever. Is there a way to check my history beyond the last like 10 calls I can see on recent history?
Edit: I just went and looked and saw my key had been idle for ten minutes and went and manually tried to make a call on the tornapi webpage, and still too many requests
Try a different debugging approach. Disable your script, delete the corresponding API key, and wait until the blockage is cleared.
Then create a new API key and use it manually on api.torn.com. Try to reach the limit of 100 requests per second. Basically you hit the "Try it!" button twice per second for a whole minute. Eventually I got
And a minute later the manual requests worked again.
Make sure you somewhat count the number of manual requests you make to see if the blockage occurs before 100.
Next step
I have no idea what kind of script you are using. But you should be able to add some debugging output to it which includes a counter for the request number and an exact timestamp. That is the basis of doing your own further investigation into this problem. Once you have clear, timestamped data supporting your issue it will be much easier for the Torn devs to verify what is going on.
If you still need help with changing your script you could join the Torn API discord at https://discord.gg/2wb7GKN and ask around there.
Then create a new API key and use it manually on api.torn.com. Try to reach the limit of 100 requests per second. Basically you hit the "Try it!" button twice per second for a whole minute. Eventually I got
{ "error": { "code": 5, "error": "Too many requests" } }And a minute later the manual requests worked again.
Make sure you somewhat count the number of manual requests you make to see if the blockage occurs before 100.
Next step
I have no idea what kind of script you are using. But you should be able to add some debugging output to it which includes a counter for the request number and an exact timestamp. That is the basis of doing your own further investigation into this problem. Once you have clear, timestamped data supporting your issue it will be much easier for the Torn devs to verify what is going on.
If you still need help with changing your script you could join the Torn API discord at https://discord.gg/2wb7GKN and ask around there.
Are you still having this issue? If so, we can perhaps set up a special log just monitoring your key to find out exactly what's using up these requests - but of course, that really is a last resort as it's a lot of work.
Still no idea what was happening, but I am not longer having the issue.