Skip to content
TORNLIFE More

API Requests Per Minute

Started by McNeo [864688] on in API Development.

8 replies · 197 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 9 / 9 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
9
Discussion span
→
People posting
6
Likes on archived posts
1
Posts by staff, officers and moderators
4
Authority score
76 / 100
Historical score
33 / 100
Story score
28 / 100
Engagement score
51 / 100

Most-liked replies

McNeo [864688]

So, random thought. With the API release we'll probably see a ton of services and features made available that use this. So even though 100 requests a minute seems fair, I'm sure people will try running multiple things and potentially reaching that 100 requests per minute mark.

You're obviously tracking requests per minute for everyone if you intend to block users who exceed it, so would it be possible to have that value returned with API requests?

Obviously we could build such checks into our own scripts, but again, for people running multiple things is where this becomes an issue. If it's a number you can make available developers could easily add a catch to pause requests for 10 seconds if the number of requests in the last minute exceed 95, for example.

This would help players not hit the limit and get blocked, and would help on your end to not have so much going on to process those blocks.

Just a thought.
aurel1 [1046304] Admin Staff

We are trying to provide only relevant info with each request. Any kind of 'technical' info with each request is not very clear way. It's something that client should (and can) control on it's own side.

However, if this will be an issue, perhaps this info can be included.
Chedburn [1] Admin Developer

Also providing that information might incentivise people you use up all of their limit. It's not a recommended usage amount, it's the absolute maximum cap. You should be able to achieve whatever you're doing with a fraction of it.
LouBaker [1162207]

the 100 cap is good enough for general day to day use and i gree with it

we have not seen yet how popular this will get and many many more scripts with be run daily

what happens in wars

with API scripts coming out nobodys going to be counting how many times they called the API

will factions or members be able to sign up for a over flow cap or something

thanks ched love the API, lots of new stuff will come from it

:)
IceBlueFire [776] Officer Officer

There's still no need for more than 100 requests a minute. I struggle to come up with what you would need more than that for.
McNeo [864688]

Say someone wants to make something that provides near-real-time data. 1 request per second is 60/100. You're over halfway there with one app.

Even 1 per second seems unreasonable, consider this:

CityWatch makes a request every 5 seconds. That's 12/100 for the minute. Not bad, but what if you had a couple programs going at once?

Still, 100 per minute seems fine, and that's not my personal argument, my only thought was seeing if there's a way to get the count is all.
LouBaker [1162207]

It wouldn't be hard to hit the 100 cap

if you where to read 100 members profiles and some of there Personal Stats, this would be 1 API call to collect there IDs and Names then 2*Api calls per member for profiles and PersonalStats

thus reading the first 50 members you would breach your cap by 1 call, total = 101 calls, slowing this down on a timer would take 2 mins to fill out the form.

I know you all going to shout at me telling me there are other ways to do this, yes i know i can just read the faction info page and get all the members info i need. and only reading certain members profiles.

I'm just putting this out there

also where does the Minute start, is it per minute 0-59 or from when you first call your API and the clock ticks for there

when/where do we start counting
IceBlueFire [776] Officer Officer

Well, that's the point of being smart with your API calls. The point is, 100 is plenty if you use them correctly.

First you do:
http://api.torn.com/faction/ID?selections=basic&key=

Then you do:http://api.torn.com/user/ID?selections=profile,personalstats&key=

You now have your entire member list in the first call, and now you can use that one array for the next call. You can put a sleep in every 20 calls or something, just to make sure you don't time out. But i can't imagine why you'd want to do this every minute anyways.

This is a very specific example btw. There aren't that many 100 member factions, and if you are going to do it on a 100 member faction, you just need to be smart about it like i said.

The whole point of it all though is to provide information at a reasonable rate, not create a live update of everything happening to everyone in Torn. You gotta be smart with your design and your implementation, and use what you've got. There still isn't a big enough argument to increase the limit here.
Rino_007 [344056]

If someone is going to use multiple scripts that rely on api perhaps the user should find a way they all can work in tandem. 100 a minute is quite a lot really. From Chedburns prospective more requests= more things the server has to do, so 100 is already being very generous.