Skip to content
TORNLIFE More

Torn API

Started by Wolverine [1971836] on in Bugs & Issues.

27 replies · 939 views · thread synced · 8 days ago · View on torn.com
About this thread

Posts archived: 28 / 28 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
28
Discussion span
→
Authority score
62 / 100
Historical score
42 / 100
Story score
54 / 100
Engagement score
73 / 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

Wolverine [1971836]
It's a lot of days that Torn API is unstable because I often get this error from Torn backend:
Backend error occurred, please try again

Another error was:
Server side error code: 0, Message: Http failure response for https://api.torn.com/user/?selections=log&from=1687132801&to=1700468152&cat=217&key=MYAPIKEY: 0 Unknown Error

The log in the browser console is:
Access to XMLHttpRequest at 'https://api.torn.com/user/?selections=log&from=1687132801&to=1700805679&cat=217&key=[API key removed]' from origin 'http://localhost:4200' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I don't know why Torn raises a CORS error from time to time.

[image: i.imgur.com]

Please can you make Torn a stable game?
Thanks.
Chedburn [1] Admin Developer
You refer to the entire API and even the whole game being 'unstable', however the information provided only specifically relates to the 'log' selection. Can you confirm that this is only seen on the 'log' selection please?

If so, how often are you hitting this selection from your account / IP address? There would be pretty strict rate limits there.
Wolverine [1971836]
yes I confirm that it's the log selection and I was requesting 1 log api per second (I tried also 1 log api call every 650 milliseconds).

Now I made my source code more robust in order to detect those errors and retry the API calls (that way I'm able to get all the logs I need, but without those retry attempts it's very difficult to get all the logs I need without being interrupted by a Torn backend failure).

Anyway it's failing also when I try to get the personal stats of all the members of a faction: 1 personal stats API request every 650 millisecond (it's a lot of months that I use those api without errors, but it's some days that I'm getting several error along the process).

Even when I use personalstats API it seems that it's slow.

Also when I get the bazaar prices API it's very slow: before (before halloween?) I got that data instantly, while now it sometimes takes several seconds.
Wolverine [1971836]
this morning Torn API doesn't work or it's very slow in the best scenario: 15 seconds to simply retrieve current personal stats
Messi [2393284]
API is not working for me at all, both TornPDA and TornTool useless, tried on api.torn.com and got no results (no error or any results)
GalacticShrimp [2802829] Reporter
To add the data I have:
In the last 11h40m (since 0tct) of all my requests (about 18 per minute), 12% take over 33s (the timeout I use), 70% take on average 18s to complete (the 10% percentile is 14.2s, the 50% percentile is 18.9s, the 90% percentile 24.5s for successful calls) and 3% end in an 5xx error.
This is using mostly user and market endpoints.

edit: This is in contrast to the median response time of 0.1s on the 15h between 1tct and 23tct
wap [2034431]
API has been failing for me for many hours per day for a number of days now. It happens exactly at the time of the daily reset.
Wolverine [1971836]
I agree: I don't know why this bug report has still the status "info required" if it occurs very often and it lasts long enough for the developers to investigate the issue.

It should have the status "confirmed".
GenShinigami [2664617] Reporter
I'd like to add in my experience. The last 3 days or so, as soon as new day rolls around, the API becomes basically non-functional. My service runs checks against the Attacks and Bars calls (as well as Basic) to verify outgoing attacks and losses.

The last three days, consistently, at new-day rollover the API starts crawling in its response speed, if we even get a response. New Day Friday is when it appears to have begun.


If I understand right, this change seems to have occurred at the same time that Ched said he was changing the new-day updates to be slightly staggered. I don't know if anything in that change would impact the API. But all of the communities I'm in that make heavy use of the API have noticed it too. YATA, Torn Stats, TornTools, faction bots, and so on.

The first day, it went for nearly 12 hours. The second day, closer to 6 or so. It's started today, and maybe we'll be lucky enough for it to keep reducing.


I've never been someone to make umbrella statements claiming the API is broken, but something has changed, it is operating MUCH less effectively than it was less than a week ago, specifically after new-day rollover, and for multiple hours following. I recognize it's a weekend, so there likely won't be anyone to try and do a deep dive to fix things until the morning. But I look forward to the problem being addressed in some way.
GalacticShrimp [2802829] Reporter
the response times I saw for user and market endpoints over the last 4 days (time in tct+1):
[image: cdn.discordapp.com]

The peaks are when most/all requests timeout (timeout is set to 33s). On the 15th we see the usual API drop on the new day, on the following 3 days we can see how the API is practically unusable for multiple hours (0tct to about 12tct on the 16th, 0tct to 6tct on the 17th and 18th).
KyleWaxedU [1013799]
it is not only the log section

Pretty much everything stops working around new day for hours for the last few days. I'm not getting error codes back just no responses.

upon checking the api page to try it like that it acts like an api key isnt even present to make a selection.