Upcoming API changes | API Development | TORN

Upcoming API changes

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 939
    • Karma: 2,613
    • Last Action: 19 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Thread created on 18:44:24 - 28/05/24 (1 year ago)
    |
    Last replied 09:12:38 - 05/06/25 (7 days ago)

    Hello everyone,

    Some of you may know me already, but for those who don’t, let me briefly introduce myself.

    I’m Mauro, senior backend engineer and a long-term Torn player (I’ve been playing this game for more than 10 years). I’m excited to announce that I will be working on and managing Torn’s API from this point onwards.

    I look forward to working closely with everyone here to make Torn’s API more robust, standardized and better documented.

    In the upcoming months, plan is to…
          *  Freeze v1 completely (except for any critical issues, exploits or if serious optimizations are needed)
          *  Work on v2 and refactor some of the codebase
          *  Standardize v2 to follow up the same standard on naming conventions, types, etc.
          *  Fix various bugs
          *  Introduce OpenAPI specification (now available here: https://www.torn.com/swagger/index.html#/
          *  Enhance existing features
          *  Add new features
          *  Optimize some of the more heavy requests
          *  Publicly release v2 once it is in a meaningful state

    If you have any suggestions, improvements, criticism or any (constructive) feedback at all - I’m more than happy to hear it!

    Also, If you suspect any kind of abuse or think any part of the API might be abused, don’t hesitate to let me know.

    Please note that once v2 is released, it will be still be unstable and there will be breaking changes from time to time. I will try to communicate such changes upfront, but I can’t promise anything at this moment.

    Thank you,

    Mauro

    --


    Recent API changes summarized can be found on API docs page: https://www.torn.com/api.html 

    Last edited by splent on 14:18:41 - 16/05/25 (27 days ago)

    ba624a17-d937-46f0-96eb-e7ed7d5951b1-2088243.jpg?v=1940629196397

  • Pinned Response
    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 939
    • Karma: 2,613
    • Last Action: 19 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 17:14:09 - 03/06/25 (8 days ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 

    There are a few new selections available, and some refactoring was done. Here are the updates:

    • [API-v2] Removed deprecated sci-fi in UserCrimeDetailsBootlegging (now replaced with sci_fi)
    • [API-v2] Removed deprecated co-leader_id in FactionBasic (now replaced with co_leader_id)
    • [API-v2] Removed deprecated non-attackers in FactionChainReport (now replaced with non_attackers)
    • Updated 'user' -> 'log' selection to only work when requested separately (affects both API v1 & v2)
    • [API-v2] Created a new selection 'faction' -> 'raids' to get raids history for a faction
    • [API-v2] Created a new selection 'faction' -> 'raidreport' to get details for a completed raid
    • [API-v2] Created a new selection 'faction' -> 'warfare'. This selection reflects faction warfare page, and returns a list of records depending on the chosen category : ranked, territory, raid, chain, db. This also deprecates cat query parameter in both 'faction' -> 'rankedwars' & 'faction' -> 'territorywars' selections
    • [Swagger] Added missing active value to FactionApplicationStatusEnum 

     

    I disliked mixed functionality of 'faction' -> 'rankedwars' & 'faction' -> 'territorywars' (offering wars list for both individual factions and general ongoing/active wars), and the complicated code to achieve that, so for this reason there's now 'faction' -> 'warfare'. 

    With this new selection, cat query parameter is now deprecated in above mentioned selections, and the responses from those chosen categories.

     

    Deprecation notices!

    • Deprecated cat query parameter in 'faction' -> 'rankedwars'. This functionality is moved to 'faction' -> 'warfare' selection and will be removed on 1st September 2025. This selection should only be used to fetch ranked wars history for your own or for another faction.
    • Deprecated cat query parameter in 'faction' -> 'territorywars'. This functionality is moved to 'faction' -> 'warfare' selection and will be removed on 1st September 2025. This selection should only be used to fetch territory wars history for your own or for another faction.


    You will also notice how new 'raids' & 'territorywars' selections have aggressor & defender objects instead of factions array.

    I'm hoping to update other such selections which use 'factions' array to use aggressor/defender objects instead.

    I'll also work on building the bazaar directory API very soon™.

     

    With this, the faction API is mostly complete, with the exception of the inventory related selections which will get properly refactored once side-wide inventory refactor is finished.

     

     

    --

    The Swagger schema is now updated as well (if you're not seeing changes make sure to hard-refresh the openapi.json file).

    Please let me know if you encounter any bugs or would like something improved in the discussion thread

    Thanks!

     

  • Pinned Response
    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 939
    • Karma: 2,613
    • Last Action: 19 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 09:12:38 - 05/06/25 (7 days ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 

    The bazaar directory API is now available in API v2. It pretty much reflects the bazaar directory page, except local/favourite bazaars are not there in this selection.

    You can also pass specific item ID or item category to get specialized bazaars.

    Please note that this API may be unstable or break unexpectedly as changes are are made to the bazaar directory itself. 

     

    There's also now 'bazaar_is_open' field available in 'user' -> 'bazaar' which indicates if the bazaar is open or closed. 

    --

    The Swagger schema is now updated as well (if you're not seeing changes make sure to hard-refresh the openapi.json file).

    Please let me know if you encounter any bugs or would like something improved in the discussion thread

    Thanks!

     

    • Flid [2594918]
    • Role: Civilian
    • Level: 100
    • Posts: 699
    • Karma: 706
    • Last Action: 1 hour
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 18:55:45 - 28/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    This is fantastic news! 

    • Kwack [2190604]
    • Role: Civilian
    • Level: 15
    • Posts: 2,346
    • Karma: 3,234
    • Last Action: 47 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 18:57:10 - 28/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Will inventory access be restored to v1 post-inventory migration, or will it only be available for v2?

     

    I presume this would fall under the exceptions for V1 changes. 

     

    I know you're waiting on other teams before you can do anything, but any information on when we could expect that inventory selection returning? We get asked this regularly over at PDA and currently my answer is "shrug, I'm not sure"

     

    edit forgot to mention - congrats! Looking forward to the future of torn's api 🎉

    Last edited by Kwack on 18:57:45 - 28/05/24 (1 year ago)
    • MightyGoober [812478]
    • Role: Civilian
    • Level: 100
    • Posts: 6,571
    • Karma: 20,235
    • Last Action: Now
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 19:01:37 - 28/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Welcome to the Torn dev team!

     

    Looks like a great plan outlined.

     

    Execute Order 66 Meme Generator - Imgflip

    • pobk [3171827]
    • Role: Civilian
    • Level: 58
    • Posts: 166
    • Karma: 178
    • Last Action: 7 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 20:36:53 - 28/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Hello!

     

    I suspect I may be preaching to the choir, but I think a properly documented and publicly published roadmap with bugs/issues tagged against key milestones, and a rigorous development process which includes community involvement, might alleviate any "breaking" of changes that you might come across.

     

    We can handle unstable, as long as we know it ahead of time.

     

     ~ Rich

     

    p.s. I'm an opinionated pain in the ass. I'll apologise in advance if it helps.

    Last edited by pobk on 20:37:18 - 28/05/24 (1 year ago)

    ~ P

    Support my suggestions: Faction API Keys

    • Omanpx [1906686]
    • Role: Civilian
    • Level: 100
    • Posts: 3,298
    • Karma: 22,242
    • Last Action: 3 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 21:05:07 - 28/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Congrats on the new position! Looking forward to updates and increased stability (fingers crossed!).

     

    One feature that would be nice to have is some sort of Forum API - it would create more opportunities for community-run events, such as this one. Something like Poster name, ID, time posted, last edited, post content, likes, dislikes.

    Now if you'll excuse me, i'm off to scrape 50+ pages of posts to get the user IDs for the event :D

    Toolbox - a collection of my tools and spreadsheets made for Torn.

    Guidebook - a collection of guides i made for Torn.

    • Kwack [2190604]
    • Role: Civilian
    • Level: 15
    • Posts: 2,346
    • Karma: 3,234
    • Last Action: 47 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 21:21:33 - 28/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Omanpx [1906686]

    Congrats on the new position! Looking forward to updates and increased stability (fingers crossed!).

     

    One feature that would be nice to have is some sort of Forum API - it would create more opportunities for community-run events, such as this one. Something like Poster name, ID, time posted, last edited, post content, likes, dislikes.

    Now if you'll excuse me, i'm off to scrape 50+ pages of posts to get the user IDs for the event :D

    Yes please, something like this would be awesome. Access to the updates column via api (feed/subs/friends) would be nice too. 

     

    Also wouldn't mind an ability to search the forums but I understand that wouldn't really mix well with the current style of the api.... a duck can dream though. Being able to get notifs for people mentioning my name would be sick

    • Lazerpent [2112641]
    • Role: Civilian
    • Level: 100
    • Posts: 870
    • Karma: 4,139
    • Last Action: 2 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 23:18:45 - 28/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Welcome! Super excited to have a developer focused on API changes.

     

    One thing I think I and almost every developer would love to see is some sort of OAUTH2! 

    • Stig [2648238]
    • Role: Reporter
    • Level: 100
    • Posts: 1,331
    • Karma: 3,197
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 00:07:09 - 29/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Welcorme, and nice name! Very excited also to have an independent developer working on the API, and what the future of the API could look like. 

    A few useful things off the bat:

     

    • Auction House API
    • Standardisation as you mentioned
    • Documentation for the new devs

     

    All the best. 

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 939
    • Karma: 2,613
    • Last Action: 19 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 10:22:48 - 29/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Kwack [2190604]

    Will inventory access be restored to v1 post-inventory migration, or will it only be available for v2?

     

    I presume this would fall under the exceptions for V1 changes. 

     

    I know you're waiting on other teams before you can do anything, but any information on when we could expect that inventory selection returning? We get asked this regularly over at PDA and currently my answer is "shrug, I'm not sure"

     

    edit forgot to mention - congrats! Looking forward to the future of torn's api 🎉

    It's hard to say right now. That really depends on at what stage will v2 be after the inventory migration.

    If there will still be a long way to finish v2, I think it will be reasonable to restore inventory section on v1 until then (provided it won't be too much db heavy). 

    As to on when is this going to happen - I can't provide any information there unfortunately.

    And thank you!  :)

    ba624a17-d937-46f0-96eb-e7ed7d5951b1-2088243.jpg?v=1940629196397

    • Prokrist [585251]
    • Role: Civilian
    • Level: 100
    • Posts: 2,198
    • Karma: 163
    • Last Action: 50 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 12:59:29 - 29/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Am I the only one who hates the key value thing I see everywhere in the torn api? 

     

    Happy to see an open api documentation for the V2 version of the API. Code generation is just not a fun experience with the torn api, open api should fix that :)

     

    Is V2 going to be able to tell me how many calls I have left? Should be somewhere in the response body !

     

    3dccaef6-d107-4b06-85cf-17ec486d2c1c-585251.gif?v=1940629196397

    • DeKleineKobini [2114440]
    • Role: Committee
    • Level: 100
    • Posts: 3,970
    • Karma: 5,573
    • Last Action: 2 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:18:15 - 29/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    One of the most important things in my opinion is to streamline the suggestion process for the API. Currently it's driven by someone making a B&I post, Ched responding with "live in production" and that's that (slightly exaggerated of course, but the point is still the same), even if we are talking about breaking changes.

     

    Documentation and an OpenAPI spec would be great, as what we currently have for official documentation doesn't even qualify to be called documentation imo. I'm trying my best to maintain a third-party documentation project, but first-party is always better.

    Last edited by DeKleineKobini on 13:20:00 - 29/05/24 (1 year ago)
    • tiksan [2383326]
    • Role: Civilian
    • Level: 100
    • Posts: 1,030
    • Karma: 1,402
    • Last Action: 17 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 16:49:28 - 29/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Prokrist [585251]

    Am I the only one who hates the key value thing I see everywhere in the torn api? 

     

    Happy to see an open api documentation for the V2 version of the API. Code generation is just not a fun experience with the torn api, open api should fix that :)

     

    Is V2 going to be able to tell me how many calls I have left? Should be somewhere in the response body !

     

    Are you referring to JSON? 

    https://cdn.discordapp.com/attachments/719011659561173012/1237732490513481809/Sith_Larping_Asshats.gif?ex=678f8935&is=678e37b5&hm=6d9a2ed93994782d9020538e0ec71a3d072964d584aceb09e9e6f547752d41e0&

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 939
    • Karma: 2,613
    • Last Action: 19 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 22:14:52 - 29/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Thank you everyone - there are some solid suggestions and advices here!

    I'm still getting familiar with the codebase, but setting up a public project board is also something Chedburn suggested I should probably do, so I'm definitely open to doing that. It will just take some time to structure everything and write everything down, but we'll get there.

    @DeKleineKobini - you do have a point. I agree that the current way of how API changes were made wasn't the easiest for those using the API, but considering how many things Chedburn is managing and doing, I think it's great he even managed to update the API at all!
    Better documentation and OpenAPI spec is definitely something I see as a priority and must have have in v2.

    I'll also set up a separate thread here for suggestions soon. 

    @Stig - auction API is something I too asked about a month ago - https://www.torn.com/forums.php#/p=threadsf=19t=16392176b=0a=0start=0to=24644707 and it's definitely something I'll look into at some point, but it might have to wait until the inventory rebuild is completed.

    @Omanpx & @Kwack - I'll have to find out what could be done about the forum API, but I wouldn't be too optimistic here, at least not right away. I'm also not saying no, but I'm just seeing many potential issues here, especially considering the amount of data that forums hold.
    But, I do like the ideas and especially considering it could enhance community driven events like the one you mentioned I'll investigate!

    Thanks!

    ba624a17-d937-46f0-96eb-e7ed7d5951b1-2088243.jpg?v=1940629196397

    • Prokrist [585251]
    • Role: Civilian
    • Level: 100
    • Posts: 2,198
    • Karma: 163
    • Last Action: 50 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 22:16:32 - 29/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Prokrist [585251]

    Am I the only one who hates the key value thing I see everywhere in the torn api? 

     

    Happy to see an open api documentation for the V2 version of the API. Code generation is just not a fun experience with the torn api, open api should fix that :)

     

    Is V2 going to be able to tell me how many calls I have left? Should be somewhere in the response body !

     

    tiksan [2383326]

    Are you referring to JSON? 

    Where?

    3dccaef6-d107-4b06-85cf-17ec486d2c1c-585251.gif?v=1940629196397

    • TurtReynolds [2472641]
    • Role: Civilian
    • Level: 84
    • Posts: 270
    • Karma: 172
    • Last Action: 32 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 22:17:59 - 29/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    You've probably heard this thousands of times, but an Auction House API would be amazing :D

    :P

    • Hemicopter [2780600]
    • Role: Civilian
    • Level: 80
    • Posts: 1,860
    • Karma: 4,456
    • Last Action: 2 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 09:14:40 - 30/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    I think that the crimeHubApi data should also be accessible through the normal player api. (This is data regarding what projects you currently are working on, how your card skimmers are doing, etc.)

     

     

    • Neodork [3026725]
    • Role: Civilian
    • Level: 27
    • Posts: 25
    • Karma: 28
    • Last Action: 2 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 18:55:38 - 30/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    The ability to paginate through more than the latest 100 reports on the user report endpoint, would be greatly appreciated.

    Creator of www.tornspy.com.

    • RaJez [2872321]
    • Role: Civilian
    • Level: 66
    • Posts: 70
    • Karma: 14
    • Last Action: Now
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 20:13:57 - 30/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Congrats, splent!!  I'm so excited for what the future holds reading your inital roadmap.  Amazing news!

    • Heartflower [2626587]
    • Role: Civilian
    • Level: 100
    • Posts: 373
    • Karma: 527
    • Last Action: 18 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 18:48:21 - 31/05/24 (1 year ago)
    Post link copied to clipboard Copy post link

    Congrats on the job, I'm excited to see a more stable and standardised API at some point!

Reply
Thread Title: