Skip to content
TORNLIFE More

Help us drastically reduce the amount of API-calls

Started by Fr00t [2518990] on in API Development.

2 replies · 368 views · thread synced · 10 days ago · View on torn.com
About this thread

Posts archived: 3 / 3 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
3
Discussion span
→
People posting
2
Likes on archived posts
42
Authority score
52 / 100
Historical score
22 / 100
Story score
35 / 100
Engagement score
56 / 100
Fr00t [2518990]
Hi,

I've previously attempted these requests in the suggestion forums, but seeing as the API is kinda niche it's hard to get any traction. The Torn-API Discord made me aware that the documentation that says "Suggestions can be posted in Torn's API forum" - so I'm gonna attempt that here.

I'm the creator of Tornattackcentral (currently offline due to OVH-fire). It allows users to track their attacks, and the API-calls are made from my server. There are some data that I extrapolate from the API. You can calculate the ELO won/lost in an attack by looking at the players ELO before and after a single attack. Similarily you can do this with amount mugged and also how much HP is lost in a fight. The only criterea is that you get a datapoint before and after each attack, which is obviously taxing on the servers on both ends.

Simply add ' "mugged" : 0', ' "elo": 12 ' , ' "hploss": 750 ' to the API. mugged would be null for attacks that are not "Result: Mugged". The other two I guess are self-explanatory


The data is already in the API, so I don't see the negative aspects of adding these as simple datapoints in the ?attacks section. It would drastically reduce the amount of API-calls TAC needs to make, and I bet for a lot of other developers too. Thats a win-win for devs and Torn :)

Mentions: ELO-change in API

Fr00t [2518990]
Just to put things into perspective with regards to the calls Tornattackcentral makes:

For every user I try to get data as often av possible to be able to store amount mugged. This ideally means about once every minute. At the same time I'm running into the IP-cap of API-calls and so I reduce the amount of calls I make for players that haven't been online recently. In total I do about 850-900 000 calls per day to track attacks for my users.

With this change I could reduce this to a call per 15 or even 30 minutes. That would reduce the amount of calls I make with about 700 000 per day. In addition we would always get the data we want. Currently I'm only able to fetch amount mugged in about 6/10 attacks cause players do multiple attacks within the windows I'm able to scrape.

This change would also make TAC way lighter on the host which would be very much appreciated.
Kaosala [2606412]
It makes sense and would be interesting to see what metrics could be done with the data if it was easily accessible to third party services like tac, yata or stats for example. Could really open up mugging