Skip to content
TORNLIFE More

API Calls Per Minute

Started by McNeo [864688] on in API Development.

33 replies · 472 views · thread synced · 5 days ago · View on torn.com
About this thread

Posts archived: 34 / 34 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
34
Discussion span
→
Authority score
78 / 100
Historical score
43 / 100
Story score
41 / 100
Engagement score
69 / 100

People posting, likes and official posts are not counted for this thread yet: on threads longer than one page they come from a periodic pass over the archive, which has not covered it.

Most-liked replies

McNeo [864688]

As the API becomes more and more popular, I thought it might be nice to get one central place for players to track their API usage to avoid errors. I've starting a suggestion thread for Torn to automate this, but it's not really getting off the ground, here.

The second-best thing to do would be to have developers share how many API calls their software makes, so players can balance their API usage. So, developers, please reply or PM me with your scripts API usage and I'll update this post so we can share a master list of usage.

Current API call per minute per player maximum (set by Torn): 100

API calls per minute (unless otherwise specified) by script/program (alphabetical):

Chain Watch by McNeo
12
* various one-time calls are also made periodically
DoctorN by Mauk
0-12 (user-customizable update frequency)
Frozen Oceans by Scripthen
1-95 (user-customizable update frequency)
IRC Bot by Swatsicle
30-40 requests at once, per half hour
2 requests per item with a !value call
* various one-time calls are also made periodically
Price Checker by McNeo
2 requests when program is launched
2 requests when selecting an item
Stocks Tool by NZSAS
1 every 15 minutes
TornStats by IceBlueFire
36 while a chain is running (if you have faction AA permissions)
12 while no chain (if you have faction AA permissions)
* various one-time calls are also made periodically
TornStats UserScript by IceBlueFire
1-2 per user profile page load
Torn Tools by McNeo
6-12 (user-customizable update frequency)
2 when using the Price Checker page or selecting an item
1 when using the TravelRun page for the first time since launching the program
* various one-time calls are also made periodically
Warbase Tool by NZSAS
1-50 (user-customizable update frequency)

Most online and IRC scripts only make 1-2 calls when you specifically request information, but it depends on the script, so check with the developer if you don't see it listed above and you're not sure.

Mentions: Add API Call History

Swatsicle [1593313]

My IRC bot bursts ±30-40 requests when it has to update flower prices. It will do so once per half hour at worst.

Other than this, one call for most commands if they use the API at all, besides !value, which does two calls per item. (It accepts multiple entires).
Mauk [1494436]

I found that for CityWatch-like tools, 12 calls per minute (an update every 5 seconds) is my personal sweet spot. The API has so much latency, even under normal circumstances, that anything faster than that ends up being a waste several times a day when the API lags.

My (unreleased) tool, DoctorN, uses that by default.
Meme_Raven [1891116]

FO uses 40 calls for 1 second refresh intervals on main.
Each module can use anywhere from 1 to 45.

Grabs only necessary data then uses internals to keep track of everything.
Refreshes to cooldowns every now and then to keep in sync.
Globally throttled to only use 45 calls, adjustable.
HandsomePants [1897243]

I don't understand the TornStats calls? What needs updating every 2 seconds there? Because between that and running Chain Watch, I'd be over 50 calls per minute during every chain.
IceBlueFire [776] Officer Officer

It's meant to be a substitute to Chain Watch. It'll update your chain bar every 2 seconds (30) and it'll update your attack news every 10 seconds (6) when there is a chain running. If there isn't a chain running, it only uses 12 per minute, updating the chain bar every 10 seconds, just like the attacks.
McNeo [864688]

That would be a question for IBF, I'm not sure what it does.

Given the decrease in API calls from 100 to 50 I was considering an update to Chain Watch to reduce the interval.
Scootaloo [1590427]

Perhaps have two options? One which operates as it is now and one which updates once a minute when a chain isn't on or is past 100, and once every 10 seconds when a chain is on?
0day [1993635]

I'm working on a stock market tool. 50 requests per minute is a bit low for what I was planning, but it will have to do :)
Will update this thread once I have something worth publishing.
saeed [1826888]

i would tell you
but tbh, i have too many scripts to go through
and that requires effort.
basically, a lot. don't use my main stat checking script while using anything else. less than 80, but other than that not sure. xD
McNeo [864688]

Yeah I have a bunch of random ones out there too that I didn't list, I guess just the more common ones are handy to have here anyway. If you have any names and numbers you want added to OP just let me know.
McNeo [864688]

Yes and no. All or some. Common or uncommon.

Whatever developers want to share... In the interest of making sure players can use our tools with little or no interference, and reduce potential errors caused by exceeding the API limits.
McNeo [864688]

Okay, I'm going to call this dumb for two reasons:

1- With the latency of the API, the very best you'll ever achieve, in a perfect world is, MAYBE a 1 second delay. Though, in the real world, myself and others have experienced an average of 2-2.5 second latency. Trying to make 95 calls a minute for a single script is... Dumb.
2- Consider your customers. They may not know what all this means - they're going to look at it and go "OH COOL THINGY" and then say "OH 95 UPDATES PER MINUTE" and crank it up. Meanwhile, they're also using other "cool thingys" and end up getting API errors and getting locked out of everything.

You might consider setting a more reasonable maximum for the benefit of the players and other developers.
McNeo [864688]

I know... And users who aren't familiar with how the API works will max it out... Leaving them unable to use other scripts, and potentially receiving API errors.

And, again, the API isn't that fast, so you're not gaining anything. Best case scenario the most the API can do is 50-60 calls a minute per script anyway, so making 95 calls just wastes those precious API calls that your users could be using elsewhere.
NZSAS [382829]

well then i have one that does 1-50 calls per min (depending on how long the user wants)

and a stock watch that does 1 every 15mins

oh and another one that count war-base which you can limit the amount of calls from 1-50 (now)