Upcoming API changes - Page 16 | API Development | TORN

Upcoming API changes

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 16:01:37 - 23/04/25 (1 month ago)
    Post link copied to clipboard Copy post link

    Hey everyone,

    It looks like there were some unexpected types changes yesterday. To my knowledge, they've so far affected 'user' -> 'discord' and 'torn' -> 'education' selections. 

    I've fixed both since, but I also refactored education related selections in API v2. There's now: 

     

    You will notice that 'user' -> 'education' also contains v1 response. This is only temporary here to support TornPDA, so please only use the 'education' object as everything else will be removed soonish.

     

    --

    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

    Thank you.

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 14:09:07 - 24/04/25 (1 month ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 

    A lot of small Swagger schema improvements were made today:

    • user.level field in FactionApplication schema was changed from string to integer
    • /faction/{crimeId}/crime endpoint now has crimeId parameter set to FactionCrimeId instead of ItemId
    • FactionHofResponse type changed from array into object
    • Added missing selection values to FactionSelectionName enum
    • Added missing selection values to MarketSelectionName enum
    • Added missing selection values to TornSelectionName enum
    • Removed extra space on 'Lower Front Bruce' race car upgrade subcategory
    • /torn/attacklog 'log' parameter changed from string into AttackCode
    • Fixed some fields being returned as integers instead of strings (lister_name, target_name, etc.)
    • notes field in TornCrime schema is no longer marked as required
    • Renamed incorrect schema field 'faction_id' into 'id' in TornFactionHof schema
    • 'factionTree' in TornFactionTreeResponse changed from object into array
    • Changed type of item with ID 592 from 'Armor' to 'Item' to fix the coverage issue
    • Added a new type CrimeId for crimes related selections
    • Fixed oneOf fields having incorrect 'object' type - TornItem.details, PersonalStatsCrimes.crimes, UserCrime.miscellaneous, FactionTerritory.racket
    • /torn is now updated to use the standard ApiFrom & ApiTo parameters
    • Added missing responses to /torn, /faction, /user, /market endpoints

     

    Many thanks to @Pyrit for bringing these up and @DeKleineKobini for making me aware of 'oneOf' type issues.

    Let me know if you find any more issues with the schema so it can work better with your code-gen tools. 

     

    --

    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!

     

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 12:02:24 - 25/04/25 (1 month ago)
    Post link copied to clipboard Copy post link

    Hey everyone, more Swagger schema improvements on the way: 

    • Added missing 'race' top field to RacingRaceDetailsResponse schema
    • Added missing 'membersamount' to FactionStatEnum
    • Added 'null' type to 'miscellaneous' field in UserCrimesResponse and fixed miscellanous field for some crimes
    • Changed 'rewards' field in UserCrimeUniques schema to be of UserCrimeUniquesReward type instead of an array
    • Marked 'name' field in UserRaceCarDetails as nullable
    • Changed 'hof' field in UserHofResponse schema to be of UserHofStats type instead of an array
    • Added missing '_metadata' field to UserRacesResponse if user has no races
    • Turned all lookup responses to return only lowercase selection names and added missing FactionSelectionName enum values

     

    Thanks again to @Pyrit for compiling the list of issues.

    In other news, we've increased the amount of API keys user can have to 25 due to a popular request: 
    https://www.torn.com/forums.php#/p=threads&f=19&t=16459390&b=0&a=0&start=0 

    Please make sure to still try and optimize your tools as much as possible though:

    https://www.torn.com/api.html 

    "Please make sure your scripts are optimised to retrieve only the information required for the specific request they're making. They should be retrieving as little information as possible; this will improve loading time and reduce stress on Torn's servers."

     

    --

    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!

     

     

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 16:35:19 - 25/04/25 (1 month ago)
    Post link copied to clipboard Copy post link

    Few more Swagger schema improvements were made:

    • Added missing enum values to FactionStatEnum
    • Updated enum value factionHof into factionhof in TornSelectionName
    • Added missing 'car_item_id' and 'car_item_name' fields to /user/enlistedcars selection
    • Changed 'value' integer format in FactionHof to be 'int64' instead of 'int32'
    • Updated 'rank' field in FactionHofString to be nullable

     

    Thanks again @Pyrit for compiling a new list of issues.

     

    --

    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!

     

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 20:19:13 - 12/05/25 (1 month ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 


    Small, but I hope helpful update today : 

     

    There's now 'previous_crime_id' field in organized crimes related selections. This field can be used to determine chained organized crimes.

     

    I know it's opposite of the suggestion made (as in, the first crime would have the second crime ID) and to what we have on the Organized Crimes page, however, this is how the data is saved in our DB so it made sense to provide it this way instead of writing another query internally just to show the next crime ID in the 'rewards' object or similar. 

    If really necessary I can add it there as well though.

    --

    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!

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 15:57:03 - 13/05/25 (1 month ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 

    Today brings a new API log history selection to API v2.

     

    There's now 'key' -> 'log' selection available which shows last 250 API requests for the current key, however, due to system limitations it's currently possible to only fetch 100 rows per request. 

     

    If necessary, we might be able to store up to 500 API requests per key, but let's see first if this is sufficient.

    Please be aware this selection also consumes your API key quota and is also stored to the 'key' -> 'log' history.

     

    In other news, 'key' -> 'info' selection was also refactored in API v2 and now also shows if a key has faction or company permissions. 

     

    Additionally, I've added 'timestamp', 'comment' & 'key' query parameters to all selections for those that might want to use these them. 

    --

    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!

     

     

    Last edited by splent on 17:11:44 - 13/05/25 (1 month ago)

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 17:33:21 - 15/05/25 (1 month ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 

    Few smaller updates were done today:

    • Added 'faction_id" and "company_id" to 'key' -> 'info' selection in API v2
    • Added new item market statistics to 'user' -> 'personalstats' in API v2 (customers, sales, revenue & fees)
    • Fixed missing 'previous_crime_id' when requesting a specific organized crime
    • Fixed HoF battle_stats not being returned for custom keys in 'user' -> 'hof' in API v2


    There's also an announcement regarding API Terms of Service Guidelines.


    --

    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!

     

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:43:45 - 19/05/25 (28 days ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 


    Several smaller changes were done today:

    • [API-v2] Removed deprecated user_id, success_chance, crime_pass_rate fields from OC's related selections
    • [API-v2] Removed deprecated life object from 'faction' -> 'members'
    • [API-v2] Removed deprecated itemDetails object from 'market' -> 'itemmarket'
    • [API-v2] Added missing introduction education courses from other course's prerequisites
    • [API-v1] Added bazaar_timestamp to 'user' -> 'bazaar'
    • [API-v1] Fixed last_action sometimes being null in 'user' -> 'profile'
    • [API-v2] Fixed links using incorrect values to calculate prev & next values in 'forum' -> 'threads'
    • [API-v2] Added comment in 'key' -> 'log'
    • [API-v2] Added total to _metadata in 'user' -> 'list'

    On Friday, I also added Patch Notes to the API documentation page. I will be updating those notes instead of the OP of this thread.

     

    https://www.torn.com/api.html 

     

    --

    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!

     

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 21:05:01 - 23/05/25 (24 days ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 

    Reports related selections are now refactored in API v2 as well. Things changed a little bit - unlike API v1, it's now possible to get historical reports by using the 'offset' query parameter, however, the limit has been reduced to 25. The limit, specifically for 'stats' category remains 100. 
    There's also 'target' query parameter which can be used to get reports on a specific target. 


    So to summarize, along with some Swagger changes:

    • [API-v2] Added missing war_id in territory wars related selections
    • [Swagger] Removed unused cat query parameter from generic forum selection
    • [Swagger] Fixed HofValueFloat, HofValueString schemas
    • [API-v2] Added 'user' -> 'reports'
    • [API-v2] Added 'faction' -> 'reports'

     

    --

    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!

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 17:03:30 - 27/05/25 (20 days ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 

     

    I'm excited to announce there's a new 'faction' -> 'search' selection with advanced filtering now available in API v2. 

     

    You'll now be able to search factions by name, respect range, members range, id range or if they're currently (or not) recruiting or if the faction is destroyed. 


    This selection is standalone, and can only be requested alone (the results will be simply omitted if it's being requested along other selections).

    There are 4 fixed filters : "destroyed", "notDestroyed", "recruiting", "notRecruiting".

    There are also 3 fields that can be used as dynamic filters : "id", "respect" & "members"

    • These fields must be followed by an operation : "Equal", "NotEqual", "Less", "LessOrEqual", "Greater", "GreaterOrEqual"
    • The operation must be followed by any integer value

     

    So for example, if you wanted to get all factions that are currently looking for new members, have between 900k and 1million respect, and at least 50 members, you would add this to your request: "filters=recruiting,respectGreaterOrEqual900000,respectLessOrEqual1000000,membersGreaterOrEqual50"

     

    This selection is currently limited to returning only 20 records per request, however we'll be monitoring performance and affect this has on DB/servers, so maybe it will be possible to increase this limit in the future. 
    If all goes well with this selection, I'm really looking forward towards building search endpoints for companies and users. 

     

     

    In other news: 

    • [API-v2] Added missing description & value to bonuses array in 'user' -> 'itemmarket'
    • [API-v2] Added a new field cache_timestamp to 'market' -> 'itemmarket' which showsn when was the item globally cached at
    • [API-v2] Removed faction_id from being populated in ‘key’ -> ‘info’ if the user doesn't have faction AA permissions
    • [API-v2] Fixed id sometimes being an empty string in 'key' -> 'log' 
    • [Swagger] Changed FactionSelectionName, ForumSelectionName, KeySelectionName, MarketSelectionName, RacingSelectionName, TornSelectionName, UserSelectionName from being just enums into enum + string, so the code-gen tools don't break constantly on unexpected new selections
    • [Swagger] Removed unused cat query parameter from the generic itemmarket endpoint
    • [Swagger] Updated cat, stat & id query parameters across all generic selections to accept specific types instead of generic string or integer values

     

    If you'd like some additional filters to be added to the new selection, please let me know in the discussion thread or suggestions thread

     

    --

    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!

    Last edited by splent on 17:17:53 - 27/05/25 (20 days ago)

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 16:20:34 - 28/05/25 (19 days ago)
    Post link copied to clipboard Copy post link

    Hey everyone, 

     

    Mostly Swagger schema & bug fixes were done today: 

    • [Swagger] Removed /torn/{territoryIds}/territory endpoint, instead, territory ids can be passed as ids query parameter in /torn/territory
    • [API-v2] Added a new field attacker_item to 'torn' -> 'attacklog' if the attacker is stealthed, but has used a temporary weapon or a booster
    • [API-v2] Added missing field ranked_war_wins to UserPersonalStatsPopular in 'user' -> 'personalstats'
    • [API-v2] Added missing field total to UserPersonalStatsPopular in 'user' -> 'personalstats'
    • [API-v1] Fixed target_factionname & reviver_factionname in revives related selections sometimes being integers instead of strings

     

    --

    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!

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 17:14:09 - 03/06/25 (13 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!

     

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 09:12:38 - 05/06/25 (11 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!

     

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

    • splent [2088243]
    • Role: Admin
    • Level: 100
    • Posts: 944
    • Karma: 2,624
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 17:41:44 - 16/06/25 (11 hours ago)
    Post link copied to clipboard Copy post link

    Hey everyone,

     

    Just a couple of small changes today : 

     

    --

    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!

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

Reply
Thread Title: