Skip to content
TORNLIFE More

API Logs

Started by Brizo [2715469] on in API Development.

16 replies · 275 views · thread synced · 6 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
5
Likes on archived posts
1
Authority score
52 / 100
Historical score
22 / 100
Story score
29 / 100
Engagement score
54 / 100
Brizo [2715469]
Has anyone noticed that API Logs don't necessarily always get created based on an API Call?
I've got an API call that gets queried every 31 seconds, but it looks as though it hasn't queried in the past 5 minutes.
Nothing has changed in between the calls either which makes me believe that it must be limiting it in some form of way?

Unless there is a way to see any failed API calls that would help me diagnose the problem?
Omanpx [1906686]
What are you quering? Logs, or some other field like stocks, perosnalstats, etc. Some fields have a slower update interval, for example torn/stocks has a 1 min tick. Also, try including a timestamp to your call (most categories have it, like torn/timestamp) and check if it changes between your calls.
Omanpx [1906686]
Every section has a timestamp field, you can use something like this:
https://api.torn.com/market/?selections=bazaar,itemmarket,timestamp&key=
and check if the value of timestamp is updated between calls.
Omanpx [1906686]
You mean the API usage log? Do your calls have a comment like &comment=myCall to help you track the calls? You need to add it before the &key= part.
Brizo [2715469]
Yes, in the settings under the API Key within Torn doesn't show all logs, despite it being queried.
I know it's being queried as I'm storing the time I query it, as well as the timestamp of the API call.

I wonder if it's to do with someone else querying the exact same data and I'm getting their cached version of it so it's not making another call.

I do put a comment in under it;

[image: i.imgur.com]

From the above screenshot you can see that it says it's only queried the flame thrower, but I know for a fact it queried a donator pack too.
Omanpx [1906686]
The cache is user-specific, so unless someone is using your keys to make the same call, there should be no cache. Are you making the DP and flame calls without a delay? I'm pretty sure there is still a cache even if you change the item ID.
Omanpx [1906686]
Just checked - there is no cache if you switch the item IDs. I'd take a look at your code and make sure you are not re-using the same item ID in both logs. You could also add a 1-0.5 sec delay between the calls to be safe.
Brizo [2715469]
Made sure there wasn't any duplicate IDs and expanded the range just to see what was happening
[image: i.imgur.com]


I left this running for about an hour give or take - it was making all the calls I expected it to make according to my logs, but the API Log in torn was stating it wasn't updated in x amount of minutes.

I'll try adding a delay in between each query just to see if it makes any changes to it
Omanpx [1906686]
As far as i understand the issue, the API calls return the expected results, but are not all logged in the Torn API usage log. If that is in fact the case, it could be a major bug which could be exploited to hide malicious key usage.
Brizo [2715469]
I am convinced this is the case. I've asked my brother who also plays torn to test and he is getting the same result.
I have also tested with adding a delay and the issue is replicable.
I've posted in bug reports just incase.
MCSH [2855875]
I just checked and yes, there is this issue. I have a script that runs daily and has its own API key, but torn says it was ran 2 days ago (but I know for a fact that it ran this morning).
Brizo [2715469]
I raised a bug report and it's not considered a bug. It's globally cached and will not return on everyones calls.