Skip to content
TORNLIFE More

API call per minute tracker.

Started by PlatinumDevil [1920420] on in Suggestions.

18 replies · 221 views · thread synced · 7 days ago · View on torn.com
About this thread

Posts archived: 19 / 19 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
19
Discussion span
→
People posting
9
Likes on archived posts
31
Posts by staff, officers and moderators
1
Authority score
48 / 100
Historical score
32 / 100
Story score
54 / 100
Engagement score
60 / 100

Most-liked replies

Mentioned in this thread

DeKleineKobini [2114440] ×1

PlatinumDevil [1920420]
Hello,

I feel it would be helpful if torn showed us how many calls we are making per minute so that we can keep track of it and know if and when we are close to the limit this number could either give the number of calls in the last minute or an average of the last hour.
This would also offer the opportunity to add to the API page in settings to display the current limit of calls allowed per minute.

Example 1

[image: i.gyazo.com]


Example 2

[image: i.gyazo.com]

[EDIT]
Additional aspects suggested by DeKleineKobini [2114440] ability to access an extended log over the previous 100 requests.

Mentions: DeKleineKobini [2114440]

Jox [1714547]
I would prefere to have data about surrent number of api call made in api, so i can control. like we have timestamp in evey cattegory we shoudl have number of calls os we can add it and based on that plan when to do next call
xedx [2100735]
Although it would be nice to have this data already available to us, I doubt it will happen anytime soon. But, I know that I at least already wrap all my calls through a helper library, where I could collect this data. This data could then be posted at some sort of interval to a Google Sheets app to make it pretty, if I wanted to, that would save it for however long you wanted it to be kept. From a Torn-based Tampermonkey script, it's simply a POST (or you could use a GET, with a POST you can send a lot more data) to a Google Apps Script set up as a content service provider. Publish as a web app, and write from the script to a sheet of your own design, collecting whatever you want from all of your running scripts, provided you've instrumented a wrapper around your calls.

In other words, I use one call which is called by simpler calls from my scripts - 'xedx_TornGenericQuery(section, ID, selection, callback, param=null)',which is itself wrapped by smaller calls for common calls - I'd gather most people reading this do the same. That function can collect/collate the data, and at set intervals or via some other mechanism, maybe every 'x' number of calls or a time interval, whichever comes first - POST the data to the URL provided when you publish the content provider script you've written to receive these POSTs. The in the same script, spit out in whatever format you want to a spreadsheet - it'll even update in more or less real time for you if you want.

I may have missed some of what you are trying to accomplish, because I for instance know that the requests my scripts are making are from my IP address, as only I use my key - so not sure why I'd care about that. I'd care about the request URL, a date/time stamp, source script/extension, and errors. I don't think you need it to be done server-side.

But I do agree with the idea, just pointing out that it's relatively easy to roll that on your own. Now that you've brought it up, I'll probably add that as an option to my scripts that use the Torn API...if I do, I'll gladly share it.