seems like im getting a Temp IP ban from the API every 30 / 40 requests?
API - IP Banned?
Started by AAW [1525734] on in API Development.
About this thread
Posts archived: 17 / 17 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
- 17
- Discussion span
- →
- People posting
- 6
- Likes on archived posts
- 6
- Posts by staff, officers and moderators
- 4
- Authority score
- 72 / 100
- Historical score
- 23 / 100
- Story score
- 33 / 100
- Engagement score
- 59 / 100
Most-liked replies
- IceBlueFire [776] Officer
· 2 likes ·
IP Ban comes from requests with invalid keys. Clean up the app - IceBlueFire [776] Officer
· 2 likes ·
Well it doesn't just ban you for fun :P IP ban is to block someone from trying to brute force hack keys, which means it bans you for invalid keys. Somewhere along the way, something is wrong and it's causing …
seems like im getting a Temp IP ban from the API every 30 / 40 requests?
I'v not got that far yet, I'm reading data from saved data for testing, and only occasionally calling real time data to update it
and I am only calling in manual mode atm. I can see me having the same problem when I go live automation mode.
do you know what time limit your 30 / 40 request are done in.
IP Ban comes from requests with invalid keys. Clean up the app
The app works fine though Ice? everything works fine? but after about 30 / 40 requests bam, im temp banned?
Well it doesn't just ban you for fun :P IP ban is to block someone from trying to brute force hack keys, which means it bans you for invalid keys. Somewhere along the way, something is wrong and it's causing you to be IP banned.
You have 3 threads going for the same issue... I vote for a temp forum ban to go with the API IP ban, lol... jk jk (kinda)
i think its because of a function i was using too check if the page contained errors? which was making roughly 10 Requests per page? so i guess it was that which was causing Error: 8 (Abuse) so ive removed it and it seems okay now!
What in the world are you doing that requires 10 requests for one page load?
i had a function that would check for error 0,1,2,3,4,5,6,7,8
so for each error would be 1 request :/
Why wouldn't you store the first request and operate on that to figure out which error it was...
i wrote a function like this
function errors(error){
if($data['error']['code'] == "0")
{
$outcome = "<strong>Error:</strong> Key is empty!";
}
}
etc and the function contained all the errors
This is in VB .NET so you'll need to adapt for your language, but this is what I'm doing for my error handling...
If sJSONResult.Substring(0, 17) = "{""error"":{""code"":" Then Select Case sJSONResult.Substring(17, 1) Case "1" Call DoErrorHandler("Torn API error 1: Key is empty. Please enter your Torn API Key.", True) Case "2" Call DoErrorHandler("Torn API error 2: Incorrect key. Please enter your Torn API Key.", True) Case "5" Call DoErrorHandler("Torn API error 5: Too many requests. Your Torn API Key has made too many requests. Please try again in 5 minutes.", True) Case "8" Call DoErrorHandler("Torn API error 8: IP Block. Your IP is temporarily banned from accessing the Torn API. Please try again in 5 minutes.", True) Case Else Call DoErrorHandler("Torn API error: An unexpected error has occured. Please try again in 5 minutes.", True) End Select Exit SubElseIf sJSONResult.Length < 100 Then Call DoErrorHandler("An invalid response was received from the Torn API server. Please try again in 5 minutes.", True)End If'No errors, continuesParse = Trim(sJSONResult)
Well, I should say, that's the sloppy one lol but the only one I have on this computer. But yeah, same thing.
The error reason is sent back along with the code, so why not just pass that through?
{"error":{"code":2,"error":"Incorrect Key"}}
To provide more verbose information to the end user.
How long is the IP ban? By mistake I used my old key in my program and now it is throwing IP block error.
When I got an IP ban I want to say it lasted about 30 minutes.