Skip to content
TORNLIFE More

API - IP Banned?

Started by AAW [1525734] on in API Development.

16 replies · 251 views · thread synced · 4 days ago · View on torn.com
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

LouBaker [1162207]

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.
AAW [1525734]

The app works fine though Ice? everything works fine? but after about 30 / 40 requests bam, im temp banned?
IceBlueFire [776] Officer Officer

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.
McNeo [864688]

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)
AAW [1525734]

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!
AAW [1525734]

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 :/
AAW [1525734]

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
McNeo [864688]

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)
McNeo [864688]

Well, I should say, that's the sloppy one lol but the only one I have on this computer. But yeah, same thing.
PMV [1577993]

The error reason is sent back along with the code, so why not just pass that through?


{"error":{"code":2,"error":"Incorrect Key"}}