WOW
Upcoming API changes
-
Posted on 14:03:57 - 14/11/24 (2 months ago)Post link copied to clipboard Copy post link
Hey everyone,
I've added "timestamp" endpoint to all Swagger sections and improved the response of generic Swagger endpoints - they're no longer "any" or {}, but instead they can be "anyOf" of any section response instead.
That should further enhance the code generation, but let me know if something's not working correctly.
Thanks. -
-
Posted on 15:40:46 - 20/11/24 (1 month ago)Post link copied to clipboard Copy post link
Hey all,
A few more faction selections are now available in Swagger:
- 'faction' -> 'chain'
- 'faction' -> 'chains'
- 'faction' -> 'chainreport'
There are some changes to how these selections now work in API v2. Here's the summary:
- The 'faction' -> 'chain' selection is pretty much the same. It returns the information about the current chain. There's also "id" field added should you wish to fetch the "chainreport" selection later.
- The 'faction' -> 'chains' is now public. Just pass a faction's ID and you'll be able to get all completed chains for that faction.
Unlike API v1, this doesn't include chains that are currently ongoing or on cooldown (which are still ongoing technically). If you don't pass faction id, you'll get chains for your own faction by default. - The 'faction' -> 'chainreport' now accepts chain id as a parameter. Without the chain id it will return your faction's latest chain report (including ongoing changes). You still can't get chain reports for ongoing chains of other factions.
This selection is basically both 'torn' -> 'chainreport' and 'faction' -> 'chainreport' from API v1.
The structure was changed a little bit - faction members that were passive during a chain will instead of having all values set to 0 be a part of an array field called "non-attackers". This was done mostly to reduce unnecessary bandwidth.
I also plan on adding a new selection 'torn' -> 'chains' soon, which should return a list of chains from the Faction warfare page, as well as to retire 'torn' -> 'chainreport' in API v2, as it doesn't serve much use since it's completely replaced by 'faction' -> 'chainreport'.
These selections are currently marked as "Unstable" and will likely stay that way for a couple of weeks.
Let me know if you notice anything odd either in Swagger schema or the responses/logic itself.
Thanks!Last edited by splent on 15:42:58 - 20/11/24 (1 month ago) -
-
Posted on 22:18:41 - 24/11/24 (1 month ago)Post link copied to clipboard Copy post link
Hi,
I've removed keys from auto-generated links (_metadata & _links) in API v2 as there were a few instances when this wasn't working as expected.
Really sorry for no heads-up on this change, but I wouldn't have done it if it wasn't truly necessary, so please forgive me.
For now, the solution is to manually append "&key=your_key", to these links if you want the functionality to work.
Thanks for understanding and apologies once again. -
-
Posted on 11:57:41 - 26/11/24 (1 month ago)Post link copied to clipboard Copy post link
WOW
-
-
Posted on 13:53:37 - 26/11/24 (1 month ago)Post link copied to clipboard Copy post link
Goodbye live TTT tracking and similar community comps. Also, gonna be a big hit for multi detector, at least until we find a workaround.
-
-
Posted on 13:59:03 - 26/11/24 (1 month ago)Post link copied to clipboard Copy post link
It's huge, I'm shocked some karma whore didn't start a thread by now :-)
Seems like a very much long overdue change tbh.(For those asking, the text appeared at the top of everyone's stats pages for a short while. The pages were spinning out and not displaying any stat data at all, but it looks like it's almost ready to go.)
-
-
Posted on 19:28:44 - 26/11/24 (1 month ago)Post link copied to clipboard Copy post link
Hey Splent,
Looking at v2 Faction / Attacks, it looks like the _metadata / links still begin with '?key=', but have the key being used removed. Appending '?key= (api key)' isn't working, presumably because '?key=' is already in there pointing to nothing.
Here is an example of _metadata / links / next:
https://api.torn.com/v2/faction/attacks?key=&limit=100&sort=asc&from=1731635089
Obviously a key could be spliced into that string after '?key=', but I wonder if you intended to remove that part of it as well, so it could all be appended instead of inserted.
Last edited by _los_ on 19:29:06 - 26/11/24 (1 month ago) -
-
Posted on 23:14:33 - 02/12/24 (1 month ago)Post link copied to clipboard Copy post link
Re: the personal stats changes:
'personalstats' selection will stop returning full personal statistics data and instead will only return data for a requested category.
Does this also prevent us from requesting a few individual stats across different categories? e.g.
/user/?selections=personalstats&stat=attackslost,mailssent
Thanks!
-
-
Posted on 23:29:28 - 02/12/24 (1 month ago)Post link copied to clipboard Copy post link
Yeah, splent has said that it will continue to work (although it's still capped at 10 afaik).
-
-
Posted on 14:36:59 - 04/12/24 (1 month ago)Post link copied to clipboard Copy post link
Hey everyone,
I have great news regarding 'user' -> 'personalstats' selection!
We've managed to create a completely new system in which we're storing latest daily stats to our DB instead of FIreStore. This means the API is no longer restricted with FireStore.
The 'user' -> 'personalstats' selection has now been recreated in API v2, with everything now available in Swagger as well.
That said, it will still be possible to get all stats at once (in API v2), but you'll need to pass "all" as "cat" query parameter.
There's also a "popular" category now, which returns the most popular stats. We'd very much prefer if you use that instead of "all", but we understand there might be a legitimate need to use "all" category, e.g. for various community competitions etc.
if you think more stats should be included there, just drop me a message, but I've already tried to include everything that many tools might need.
We certainly did not have any intentions to purposefully break tools, so I can only thank everyone for the feedback - as I said in the original announcement we're open to feedback on these changes.
Hopefully this solution works well for everyone.
P.S. Some of you may get a message from me sometime soon, so we can work together on optimizing your tools (in case your tools are making more the 1,000,000/requests daily).
Thanks.Last edited by splent on 15:40:30 - 04/12/24 (1 month ago) -
-
Posted on 16:55:35 - 04/12/24 (1 month ago)Post link copied to clipboard Copy post link
Quick note regarding API v1 - I've switched it to use daily stats just like Personal Stats page now since it's no longer limited by the FireStore.
That said, you can also pass a new "cat=all" in API v1 as well, to get all stats at once.I plan on further improving API v2 & Swagger to allow passing as many stats as needed, but that will only work for snapshot stats, not for historical stats.
Thanks! -
-
Posted on 13:31:46 - 05/12/24 (1 month ago)Post link copied to clipboard Copy post link
Hey everyone,
Smol change for both API v1 & API v2 - it's now possible to pass any amount of "stat" values in both API v1 and API v2, unless requesting historical stats - these are still limited to 10 as they're being fetched from FireStore.
Historical stats are being fetched if there's "timestamp" parameter present.
I've also changed "stalemated" and "assisted" in "attacking" schema into "stalemate" and "assist".
Swagger docs are also updated.
Thanks! -
-
Posted on 15:18:27 - 06/12/24 (1 month ago)Post link copied to clipboard Copy post link
Hey everyone,
The following improvements are now live regarding 'user' -> 'personalstats' API v2 selection:- It's now possible to request "battle_stats" & "investments" categories for yourself (with "Limited" or higher key)
- Replaced some British English fields with American English for consistency and renamed some fields in general:
- "organised_crimes" -> "organized_crimes"
- "streaks" -> "killstreak"
- "playing_time" -> "time_played"
- Re-mapped a lot of possibly unclear values when requesting specific stats. The old values will still continue to work as well if you request them, but the Swagger will only show new values:
- "killstreak" -> "currentkillstreak", "itemsbought" -> "marketitemsbought", "heahits" -> "heavyhits",
- "machits" -> "machinehits", "rifhits" -> "riflehits", "shohits" -> "shotgunhits", "pishits" -> "pistolhits",
- "grehits" -> "temphits", "piehits" -> "piercinghits", "slahits" -> "slashinghits", "axehits" -> "clubbinghits",
- "chahits" -> "mechanicalhits", "theftcrime" -> "theftold", "sellingillegalproductscrime" -> "sellillegalgoods",
- "organisedcrimes" -> "organizedcrimes", "banktimediff" -> "banktimeleft", "eastereggs" -> "eastereggsfound",
- "traveltime" -> "timespenttraveling", "dubtravel" -> "uaetravel", "lontravel" -> "uktravel", "soutravel" -> "satravel",
- "useractivity" -> "timeplayed", "refils" -> "refills", "criminaloffences" -> "criminaloffensesold"
In 'user' -> 'personalstats' API v1 selection, some stats were now made public since they're now also visible on the Personal Stats page:- 'trades', 'pointsold', 'bazaarcustomers', 'bazaarsales', 'bazaarprofit', 'tokenrefills'
And finally, parameters & fields marked as "deprecated" in Swagger (marked for removal on the 1st December) were removed.
I'm hoping to mark 'personalstats' selection with "stable" tag some time soon (not before a week has passed certainly), so please let me know if there are some changes you'd like me to do in the dedicated discussion thread.
As always, Swagger schema got updated as well.
Thanks!Last edited by splent on 15:20:51 - 06/12/24 (1 month ago) -
-
Posted on 17:49:29 - 10/12/24 (1 month ago)Post link copied to clipboard Copy post link
Hey all,
Few more personal stats related changes today. These are the API v2 changes:- Added a new category "crimes" which will replace "criminal_offenses" category. This category now contains crime skill for each crime. Daily values for other players will be populated tomorrow.
- Added a missing 'fraud' field to both 'crimes' & 'criminal_offenses' categories
- Added a new field 'dump' to 'items' -> 'found' object. This makes 'trash' field in the same object deprecated
- Added a new field 'energydrinks' to 'items' -> 'used' object. This makes 'energy' field in the same object deprecated
- Fixed 'travel' -> 'items_bought' field (was returning 0 for everyone)
- Added a new object 'hunting' with field 'skill' to 'travel' category response. This makes 'hunting_skill' field deprecated (the field was being shown in an inconsistent data type)
- Added a new object 'activity' to 'other' category response. This makes 'time_played', 'current_streak' & 'best_streak' fields deprecated
- Added 'fraudold' (replaces 'arsoncrime'), 'searchforcashskill', 'bootleggingskill', 'graffitiskill', 'shopliftingskill', 'pickpocketingskill', 'cardskimmingskill', 'burglaryskill', 'hustlingskill', 'disposalskill', 'crackingskill', 'forgeryskill', 'scammingskill', 'huntingskill' to the list of available "stat" values
Changes in API v1:
- Added 'crimes' category & added all crimes skills to the response
- Added 'huntingskill' to travel response
- All of these skill should start working after midnight for others
All of the API v2 changes are available in Swagger. Make sure to hard refresh both the Swagger page and openapi.json file if you're not seeing the changes.
Thanks - let me know your thoughts in the discussion thread. -
-
Posted on 15:23:41 - 20/12/24 (25 days ago)Post link copied to clipboard Copy post link
Hey everyone,
I'm happy to announce the updated 'faction' -> 'crimes' selection is available in API v2.
It will return regular v1 response for those factions still on old OC's, however, factions that migrated to OC's 2.0 will now see a different response.
It's possible to get crimes based on status:- recruiting,
- planning,
- failure,
- successful,
- expired,
- available (includes both 'recruiting' and 'planning' crimes),
- completed (includes both 'failure' and 'successful' crimes)
This new selections has information about required items and if the required item will be used in crime or if the user joined this specific slot has it. It also has information about each role success chances.
In other news -- I've updated the description for 'lookup' fields in Swagger
- I've added a new experimental field 'is_interrupted' to 'faction' -> 'attacks' in both API v1 & v2. The purpose of this field is to help determine specifically if an "assist" contributed to the chain/war or did not. It covers edge cases such as when A attacks B, but B loses to C. This is still an "assist" for A, but did not help chain during chaining/wars at all
- I've also fixed an issue where 'war' modifier in 'faction' -> 'attacks' was showing incorrect value
All of these changes are visible in Swagger.
Finally, a small note regarding a future update - I'll be likely closing 'faction' -> 'crimeexp' after the new year.
It will still remain available in API v1, however, it doesn't provide much value for OC's 2.0. There are many more contributions to specific role success chances (which are also shown in the new 'faction' -> 'crimes' selection).Thanks - let me know your thoughts in the discussion thread.
-
-
Posted on 15:00:17 - 22/12/24 (23 days ago)Post link copied to clipboard Copy post link
Hey everyone,
I've added requested fields to 'faction' -> 'crimes' selection.
New object 'rewards' is added to the response, along with a new object 'user' under 'slots' object:- the 'rewards' object contains information about money/respect/items rewarded for successful crimes
- the 'user' object contains information about when did the user join the slot.
The Swagger schema is now updated as well (if you're not seeing changes make sure to hard-refresh the openapi.json file)
Thanks - let me know if you'd like more improvements in the discussion thread.Last edited by splent on 16:58:32 - 06/01/25 (8 days ago) -
-
Posted on 16:59:25 - 06/01/25 (8 days ago)Post link copied to clipboard Copy post link
Hey everyone,
A few small changes today:- Changed/fixed "planning" phase to only return crimes when all members are joined and the crime is not yet complete
- Changed/fixed "recruiting" phase to return crimes without members or without all slots filled
- Added "planning_at" field which replaces "initiated_at" to reduce confusion ("initiated_at" is now deprecated)
- Made some Swagger schema fixes and improvements (fixed incorrect "string" type on timestamp, removed duplicate enum values), more info here: https://www.torn.com/forums.php#/p=threads&f=19&t=16440317&b=0&a=0
I'll see if there's a way to explicitly add "completed_at" which can differ from the "ready_at" field.
Thanks - let me know your thoughts in the discussion thread.
-
-
Posted on 17:08:48 - 08/01/25 (6 days ago)Post link copied to clipboard Copy post link
Hey everyone,
There are now a few more improvements in 'faction' -> 'crimes' selection. You can now:
- see individual's planning progress in the 'user' object
- get crimes with the new "all" category
- filter crimes with "from" & "to" query parameters
Deprecation warning!We'll be removing 'id' & 'uid' from 'market' -> 'itemmarket' selection on Monday, January 20th 2025 in order to reduce the increased usage of mug bots.
Edit: no longer happening. See the post below.
Thanks - let me know your thoughts in the discussion thread.Last edited by splent on 10:01:26 - 11/01/25 (3 days ago) -
-
Posted on 17:10:52 - 10/01/25 (4 days ago)Post link copied to clipboard Copy post link
Hey everyone,
A few improvements were made to 'faction' -> 'members' selection. They are:- 'is_on_wall' boolean flag which shows if the member is currently on the wall
- 'is_in_oc' boolean flag which shows if the member is currently in a organized crime (planning or recruiting tab)
- 'has_early_discharge' boolean flag which shows if the member is eligible for an early discharge
Additionally, I think I've fixed the issue with attacks in 'faction' -> 'attacks' & 'faction' -> 'attacksfull' where sometimes few attacks go missing when using auto-generated links.
Please let me know if you find any issues with all of these!
Next week, I plan on improving the performance of 'faction' -> 'members' call as I've noticed it's taking almost a second in some cases.
Important deprecation notice withdrawal!
We will not remove 'id' & ''uid' from 'market' -> 'itemmarket' selection.
After getting some feedback and doing thorough investigation, it's clear this change would only hurt legitimate tools and would not have any effect on mug bots.
It's possible we'll make an alternative approach with using global cache (just like on 'user' -> 'bazaar' selection) instead, although it might take a little bit as implementing this with all the advanced filters could be a little bit tricky.
--
The Swagger schema is now updated as well (if you're not seeing changes make sure to hard-refresh the openapi.json file).
Let me know your thoughts in the discussion thread.
Thank you. -
-
Posted on 15:25:50 - 14/01/25 (14 hours ago)Post link copied to clipboard Copy post link
Hey everyone,
Some exciting changes today (at least for me lol):- It's now possible to pass API keys as headers. E.g. "Authorization: ApiKey rnavT95qnTCTAbdK" (don't worry, the key is invalid)
- All endpoints in Swagger are now updated to use the API key from a header and not a query (the green "Authorize" button at right side of the page)
- Deprecated fields have been removed (mostly the old ones in 'user' -> 'personalstats' selection)
- Set the default category of 'faction' -> 'crimes' to be "all" (no longer required to pass the category)
- Fixed "sort" not working in 'faction' -> 'crimes' when using offset (now you can get crimes from start or end with offset)
- Fixed some of schema errors breaking code-gen for Rust
Small note regarding 'user' -> 'newmessages'.
Currently this selection requires 'public' API key, while 'user' -> 'messages' requires 'limited' access key.
It's possible we'll change the default required key to 'limited' to match the 'user' -> 'message' selection and enhance player's privacy.
In the upcoming weeks, I'm also hoping to improve errors returned via API to return an actual error status codes (400, 403) instead of status 200 with an error object.
--
The Swagger schema is now updated as well (if you're not seeing changes make sure to hard-refresh the openapi.json file).
Let me know your thoughts in the discussion thread.
Thank you. -