API Suggestions & Improvements - Page 3 | API Development …

API Suggestions & Improvements

    • tiksan [2383326]
    • Role: Civilian
    • Level: 100
    • Posts: 945
    • Karma: 1,252
    • Last Action: 5 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 21:31:01 - 03/07/24 (5 months ago)
    Post link copied to clipboard Copy post link

    Suggestion type:

    Something else

     

    What needs to be done:

    I’m not sure if this falls under your purview, but support for IPv6 access to the Torn API.

     

    Why is this needed:

    Support for IPv6 in the API would allow developers to reduce costs (with AWS currently charging $3.65 a month for an IPv4 address). IPv6 support would also allow for greater accessibility in regions/ISPs switching to IPv6 and CGNATs (especially given the substandard quality of and the difficulty in using publicly accessible NAT64/DNS64 providers).

     

    Drawbacks:

    None that I can think, of although Ched has said that they’ll work on this in the future but I’m not sure if that applies to the API.

    LnNwLrL.gif

    • pobk [3171827]
    • Role: Civilian
    • Level: 51
    • Posts: 106
    • Karma: 150
    • Last Action: 1 minute
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 20:30:04 - 09/07/24 (4 months ago)
    Post link copied to clipboard Copy post link

    Suggestion type:

    New feature request

     

    What needs to be done:

    Expose the attacklog endpoint to the API. Given the UUID of an attack, return the attackLog detail in a JSON structure.

     

    Why is it needed:

    It's not presently possible to perform any significant analysis on historical attacks, not to mention being able to accurately estimate assistance value for assists etc

     

    Drawbacks:

    No obvious drawbacks. The attacklog can be viewed by anyone if they have the ID.

    Last edited by pobk on 20:31:35 - 09/07/24 (4 months ago)

    ~ P

    Support my suggestions: Faction API Keys

    • Hemicopter [2780600]
    • Role: Civilian
    • Level: 74
    • Posts: 1,483
    • Karma: 3,564
    • Last Action: 2 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 20:54:38 - 09/07/24 (4 months ago)
    Post link copied to clipboard Copy post link

    pobk [3171827]

    Suggestion type:

    New feature request

     

    What needs to be done:

    Expose the attacklog endpoint to the API. Given the UUID of an attack, return the attackLog detail in a JSON structure.

     

    Why is it needed:

    It's not presently possible to perform any significant analysis on historical attacks, not to mention being able to accurately estimate assistance value for assists etc

     

    Drawbacks:

    No obvious drawbacks. The attacklog can be viewed by anyone if they have the ID.

    Would that lead to attack logs not being deleted anymore?

     

    Also, Loot Rangers would probably like that suggestion too, tho we have our workarounds

    • splent [2088243]
    • Role: Admin
    • Level: 95
    • Posts: 718
    • Karma: 2,002
    • Last Action: 47 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:32:30 - 16/07/24 (4 months ago)
    Post link copied to clipboard Copy post link

    Hemicopter [2780600]

    New feature request - Add User-related crime data in v2

     

    Currently, there exist different endpoints for "global crime state", namely torn>searchforcash and torn>shoplifting.

    This is good for knowing which uniques could be gotten, but that's about it.

     

    I would like an endpoint like user>crimes, so that user-specific state can be evaluated.

     

    Why do I need it?

    There is a lot of, let's call it data analysis, you can do with real-time-ish data.

    For example, YATA could give you an estimate when you can claim your "250 details in 1 card skimmer" honor based on the state of your card skimmers.

    Another use case can be some sort of notification system for when a card skimmer gets found.

    It could also make a shopping list for your current forgery projects, and once inventory api is back, check if you need to buy some items.

     

    The list is practically endless, and with 19 more crimes coming, will be even longer. The spreadsheet people can have a field day :D

     

    This data is also already available, but for automated means inaccessible due to the scripting rules. The so called "crimesHubApi" returns user and global state of the crimes system. I would argue that most work was already done, it "just" needs to follow new v2 naming standards. The crimesHubApi is the base for showing the icons on the crime hub. 

     

    What could be drawbacks?

    - Until all crimes are released, there will have to be (ir)regular changes applied to this endpoint. 

    - As I said, the current implementation does not follow v2 naming standards.

    - The data would be available in the crimeHubApi (which does not fall under the API ratelimits) and the normal api (with its ratelimits), so there might be double the maintenance work associated with that.

    - IIRC, Ched said something about crimes not being a real time system, and things being generated "once you looked". I'm not sure how true this statement still is (and if the crimesHubApi is the thing that triggers it), but this might lead to only stale data being able to be read.

    - The data is highly irregular from crime to crime.

     

    Example:

    I'll point to the existing URL, but because I don't want to post my CF api key, you can find your personal links by being at loader.php?sid=crimes and looking in the dev tools. The URL looks like this:

    https://www.torn.com/crimesHubApi.php?userID=2780600&apiKey=XXX&rfcv=YYY

    (the crimeHubApi uses the typeID parameter to only load one crime at the time, but this is optional. Check it out without a typeID, ty!)

    Hello, 

    This has now been implemented. Please see this post for more information:

    https://www.torn.com/forums.php#/p=threads&f=63&t=16401584&b=0&a=0&start=40&to=24948515

    I know I didn't implement everything that you suggested (and what MightyGoober asked in this thread), but I might add additional information to 'user' -> 'crimes' & 'torn' -> 'subcrimes' sections in the future (such as recommended items, the amount of items user has, etc.).

    • DeKleineKobini [2114440]
    • Role: Committee
    • Level: 100
    • Posts: 3,786
    • Karma: 5,406
    • Last Action: 37 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 22:30:40 - 27/07/24 (4 months ago)
    Post link copied to clipboard Copy post link

    Suggestion type:

    New feature request

    What needs to be done: 

    New selection for players to get the current bounties on them.


    Why do you need this:
    Currently the only way to know if a player has bounties on them is through their icons, but that doesn't show all the bounties on them. 

    Consider any drawbacks of your suggestion:

    No clear drawbacks to me.

    Example:
    {
        "bounties": [

        {
            "lister_id": integer | null, // Null when anonymous.
            "lister_name": string | null, // Null when anonymous. Not necessarily for me, depending on how though it would be.

            "reward": integer,

            "reason": string | null,

            "quantity": integer,
            "placed": EpochTimestamp, // Not necessarily for me, depending on how though it would be.
            "expires": EpochTimestamp, // Not necessarily for me, depending on how though it would be. 

        },

        ]
    }

    Last edited by DeKleineKobini on 16:24:14 - 28/07/24 (4 months ago)
    • Hemicopter [2780600]
    • Role: Civilian
    • Level: 74
    • Posts: 1,483
    • Karma: 3,564
    • Last Action: 2 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 09:06:46 - 28/07/24 (4 months ago)
    Post link copied to clipboard Copy post link

    DeKleineKobini [2114440]

    Suggestion type:

    New feature request

    What needs to be done: 

    New selection for players to get the current bounties on them.


    Why do you need this:
    Currently the only way to know if a player has bounties on them is through their icons, but that doesn't show all the bounties on them. 

    Consider any drawbacks of your suggestion:

    No clear drawbacks to me.

    Example:
    {
        "bounties": [

        {
            "lister_id": integer | null, // Null when anonymous.
            "lister_name": string | null, // Null when anonymous. Not necessarily for me, depending on how though it would be.

            "reward": integer,

            "reason": string | null,

            "quantity": integer,
            "placed": EpochTimestamp, // Not necessarily for me, depending on how though it would be.
            "expires": EpochTimestamp, // Not necessarily for me, depending on how though it would be. 

        },

        ]
    }

    Not sure if that info is available anywhere, but

     

    "expire": integer

     

    could be added

    also, you switched up the types in lister_id and _name

     

    Addressed on the post, thanks :D

    Last edited by Hemicopter on 16:38:23 - 28/07/24 (4 months ago)
    • DeKleineKobini [2114440]
    • Role: Committee
    • Level: 100
    • Posts: 3,786
    • Karma: 5,406
    • Last Action: 37 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 16:23:36 - 28/07/24 (4 months ago)
    Post link copied to clipboard Copy post link

    DeKleineKobini [2114440]

    Suggestion type:

    New feature request

    What needs to be done: 

    New selection for players to get the current bounties on them.


    Why do you need this:
    Currently the only way to know if a player has bounties on them is through their icons, but that doesn't show all the bounties on them. 

    Consider any drawbacks of your suggestion:

    No clear drawbacks to me.

    Example:
    {
        "bounties": [

        {
            "lister_id": integer | null, // Null when anonymous.
            "lister_name": string | null, // Null when anonymous. Not necessarily for me, depending on how though it would be.

            "reward": integer,

            "reason": string | null,

            "quantity": integer,
            "placed": EpochTimestamp, // Not necessarily for me, depending on how though it would be.
            "expires": EpochTimestamp, // Not necessarily for me, depending on how though it would be. 

        },

        ]
    }

    Hemicopter [2780600]

    Not sure if that info is available anywhere, but

     

    "expire": integer

     

    could be added

    also, you switched up the types in lister_id and _name

     

    Addressed on the post, thanks :D

    Switched id and name types and added "expired" and "placed".

    • Wolverine [1971836]
    • Role: Civilian
    • Level: 100
    • Posts: 5,177
    • Karma: 6,010
    • Last Action: 5 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 12:32:24 - 01/08/24 (4 months ago)
    Post link copied to clipboard Copy post link

    Hemicopter [2780600]

    New feature request - Add User-related crime data in v2

     

    Currently, there exist different endpoints for "global crime state", namely torn>searchforcash and torn>shoplifting.

    This is good for knowing which uniques could be gotten, but that's about it.

     

    I would like an endpoint like user>crimes, so that user-specific state can be evaluated.

     

    Why do I need it?

    There is a lot of, let's call it data analysis, you can do with real-time-ish data.

    For example, YATA could give you an estimate when you can claim your "250 details in 1 card skimmer" honor based on the state of your card skimmers.

    Another use case can be some sort of notification system for when a card skimmer gets found.

    It could also make a shopping list for your current forgery projects, and once inventory api is back, check if you need to buy some items.

     

    The list is practically endless, and with 19 more crimes coming, will be even longer. The spreadsheet people can have a field day :D

     

    This data is also already available, but for automated means inaccessible due to the scripting rules. The so called "crimesHubApi" returns user and global state of the crimes system. I would argue that most work was already done, it "just" needs to follow new v2 naming standards. The crimesHubApi is the base for showing the icons on the crime hub. 

     

    What could be drawbacks?

    - Until all crimes are released, there will have to be (ir)regular changes applied to this endpoint. 

    - As I said, the current implementation does not follow v2 naming standards.

    - The data would be available in the crimeHubApi (which does not fall under the API ratelimits) and the normal api (with its ratelimits), so there might be double the maintenance work associated with that.

    - IIRC, Ched said something about crimes not being a real time system, and things being generated "once you looked". I'm not sure how true this statement still is (and if the crimesHubApi is the thing that triggers it), but this might lead to only stale data being able to be read.

    - The data is highly irregular from crime to crime.

     

    Example:

    I'll point to the existing URL, but because I don't want to post my CF api key, you can find your personal links by being at loader.php?sid=crimes and looking in the dev tools. The URL looks like this:

    https://www.torn.com/crimesHubApi.php?userID=2780600&apiKey=XXX&rfcv=YYY

    (the crimeHubApi uses the typeID parameter to only load one crime at the time, but this is optional. Check it out without a typeID, ty!)

    splent [2088243]

    Hello, 

    This has now been implemented. Please see this post for more information:

    https://www.torn.com/forums.php#/p=threads&f=63&t=16401584&b=0&a=0&start=40&to=24948515

    I know I didn't implement everything that you suggested (and what MightyGoober asked in this thread), but I might add additional information to 'user' -> 'crimes' & 'torn' -> 'subcrimes' sections in the future (such as recommended items, the amount of items user has, etc.).

    Thank you for the new crime API, they are useful to know the user crime uniques obtained instead of scanning all their crime logs.

     

    I can call 

    https://api.torn.com/v2/torn/?selections=crimes

    to obtain
    {
      "crimes": [
        {
          "id": 1,
          "name": "Search for Cash",
          "category_id": 2,
          "category_name": "Theft",
          "enhancer_id": 564,
          "enhancer_name": "Glasses",
          "unique_outcomes_count": 34,
          "unique_outcomes_ids": [
            786,

    Right now I don't see a way to obtain information about that 786.

    Skeletron provided me a file made manually by scanning the crime logs of many players that contains the meaning of that 786:


    "786": {
          "target": "Trash",
          "imageIDs": [
            66
          ],
          "name": "Morphine x10",
          "skill": 25
        },

     

    My request is to get a way to obtain, by using Torn API 2.0, information about "unique_outcomes_id = 786", in particular the list of image IDs, the minimum crime skill level needed to obtain that unique outcome, the requirements (i.e. Cameras disabled)

    • DieselBlade [1701621]
    • Role: Wiki Contributor
    • Level: 56
    • Posts: 1,490
    • Karma: 1,300
    • Last Action: 1 hour
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 12:01:01 - 06/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Suggestion type:

    New feature request

    What needs to be done: 

    New selection for player rank in city jobs.

    https://api.torn.com/user/?key={KEY}&selections=jobranks


    Why do you need this:
    A player can leave a city job and return to the same rank, but this information is not displayed anywhere

    Consider any drawbacks of your suggestion:

    No clear drawbacks to me.

    Example:

    {
        "jobranks": {
                "medical": 1,
                "education": 6,
                "law": 0,
                "grocer": 3
            }
    }
    Last edited by DieselBlade on 12:09:30 - 06/08/24 (3 months ago)

    8db021b7-6a5d-4507-ab53-6ac6b2fa27de-1701621.gif

    • Brizo [2715469]
    • Role: Civilian
    • Level: 96
    • Posts: 1,226
    • Karma: 64
    • Last Action: 44 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 13:52:59 - 12/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Suggestion type:
     - New feature request

    What needs to be done:
     - add API to get Auction House Data
     - this could potentially go under https://api.torn.com/torn/?selections=AuctionHouse and take the Item ID(s) as parameter(s), to filter, or provide all of ite



    Why do you need this:
    To allow for easier integration into discord. I would like the ability for users to track, and obtain pings for auctions nearing its end so they can decide whether or not to bid on it.

    I'm also sure bzimor may thank us for this endpoint as well to stop him trawling through Auctions.


    Consider any drawbacks of your suggestion: 
     - None that I'm aware of


    Example:


    {
        "AuctionHouse": [

        {
            "AuctionID": number,
            "results": [
            {   
               "TornWeaponID": number,

               "Accuracy": number,

              "Damage": number,

              "Armor": number,

               "Quality": number,

               "Bonus1": string,

              "Bonus2": number,
               "owner_id": number,
               "high_bidder_id": number,
               "price": number,
               "endTime": time/string,
            },

        },

        ]
    }

     

     

    Edit--- Apologies, I just noticed it on the miro board. That being said, it's not a terrible change to add.  A lot of people use bzimor frequently and this will only aid in its use.

     

     

    Last edited by Brizo on 14:05:24 - 12/08/24 (3 months ago)
    • DieselBlade [1701621]
    • Role: Wiki Contributor
    • Level: 56
    • Posts: 1,490
    • Karma: 1,300
    • Last Action: 1 hour
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 07:16:04 - 15/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Brizo [2715469]

    Suggestion type:
     - New feature request

    What needs to be done:
     - add API to get Auction House Data
     - this could potentially go under https://api.torn.com/torn/?selections=AuctionHouse and take the Item ID(s) as parameter(s), to filter, or provide all of ite



    Why do you need this:
    To allow for easier integration into discord. I would like the ability for users to track, and obtain pings for auctions nearing its end so they can decide whether or not to bid on it.

    I'm also sure bzimor may thank us for this endpoint as well to stop him trawling through Auctions.


    Consider any drawbacks of your suggestion: 
     - None that I'm aware of


    Example:


    {
        "AuctionHouse": [

        {
            "AuctionID": number,
            "results": [
            {   
               "TornWeaponID": number,

               "Accuracy": number,

              "Damage": number,

              "Armor": number,

               "Quality": number,

               "Bonus1": string,

              "Bonus2": number,
               "owner_id": number,
               "high_bidder_id": number,
               "price": number,
               "endTime": time/string,
            },

        },

        ]
    }

     

     

    Edit--- Apologies, I just noticed it on the miro board. That being said, it's not a terrible change to add.  A lot of people use bzimor frequently and this will only aid in its use.

     

     

    This would be awesome for bazaar and item market listings as well. Giving us the Item ID for unique items like weapons and armour would allow to stats to be retrieved much easier 

    8db021b7-6a5d-4507-ab53-6ac6b2fa27de-1701621.gif

    • KingLouisCLXXII [2070312]
    • Role: Civilian
    • Level: 100
    • Posts: 2,912
    • Karma: 2,443
    • Last Action: 2 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 04:16:57 - 19/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    https://www.torn.com/forums.php#/p=threads&f=63&t=16399202&b=0&a=0

     

    This is from a while ago but haven't been doing much dev work so I didnt see this thread. Would love if you could take a look at this request for adding turn by turn attack logs to the API

    • DieselBlade [1701621]
    • Role: Wiki Contributor
    • Level: 56
    • Posts: 1,490
    • Karma: 1,300
    • Last Action: 1 hour
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 16:44:28 - 19/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Stig [2648238]

    Suggestion type:

     - General improvement (accross multiple endpoints)

     

    What needs to be done:

    - Armourynews, attacknews, and various other ‘news’ endpoints be rebuilt entirely to provide non-html data.
    - Have weapon / item UID’s added to various locations, such as armorynews and armory endpoints

     

    Why do you need this:

    - It can be inconsistent to parse on our side, and requires us to know all types of the log to be able to parse it correctly in some cases.

     

    Consider any drawbacks of your suggestion:

    - None that I can think of

     

    Examples:

     

    [Armorynews]

    {
    "armorynews": {
    "ml4H2HEDR4XSC1op5SlI": {"news": "Stig [2648238] deposited a Gold Plated AK-47.",
    "uid": 123,
    "timestamp": 1708597707
    }
    }
    }

     

    This could be made more indepth by including ‘player’ or something and ‘target’ and more data about the item used etc.

     

    [Armory]

    {
    "weapons": [
    {
    "ID": 108,
    "name": "9mm Uzi",
    "type": "Primary",
    "quantity": 3,
    "available": 3,
    "loaned": 0,
    "loaned_to": null
    "uids": [1, 2, 3]
    },
    ]
    }

     

    Im not sure how we would signify which weapons have been loaned etc. Perhaps having each weapon in a list, instead of them being grouped is more appropriate. 

    To extend this: an API for normal armory logs would be useful. Same as attacks and revives etc.

     

    Also include if the item was donated, loaned, consumed, given or filled 

    Last edited by DieselBlade on 12:46:13 - 20/08/24 (3 months ago)

    8db021b7-6a5d-4507-ab53-6ac6b2fa27de-1701621.gif

    • L4suicide [15699]
    • Role: Civilian
    • Level: 100
    • Posts: 4,838
    • Karma: 9,056
    • Last Action: 22 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 14:30:49 - 30/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Suggestion type:
     - New feature request

    What needs to be done:
    Add users bookie bet data to user section.

    Why do you need this:
    Allows players who use the bookie a lot to analyse their betting patterns, winning areas, etc


    Consider any drawbacks of your suggestion:

    Limited set of users would have interest in this data

    Example:
    (Finally, provide an example of the API change)..

    no idea on the data stored and I’m on mobile.. so.. meh

    {
        "Bets": [

        {
            "Bet_id",
            "Bet_category_id",

    bet type

    bet value

     Wager,

    outcome,

    etc..

     

     

        },

        ...

        ]
    }

    Ranked war auction service:-

    Just 5m per day per listing

    Chat for details

    • Wolverine [1971836]
    • Role: Civilian
    • Level: 100
    • Posts: 5,177
    • Karma: 6,010
    • Last Action: 5 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 15:55:12 - 30/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Hi Splent,

    in our personal stats we see energy drinks, refills, alcohol, any different drug taken, but we don't see FHCs because they are included in the generic "boosters" category together with other stuff like lawyer business cards and erotic dvds.

     

    Do you think that FHCs could have their own section in personal stats?

    And if they are stored separately in the database (or they simply increase a booster counter in the database, in that case it would be impossible even for a developer to know how many fhcs a player used).

    • JKyte [2417425]
    • Role: Civilian
    • Level: 100
    • Posts: 758
    • Karma: 998
    • Last Action: 1 hour
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 14:30:30 - 31/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Wolverine [1971836]

    Hi Splent,

    in our personal stats we see energy drinks, refills, alcohol, any different drug taken, but we don't see FHCs because they are included in the generic "boosters" category together with other stuff like lawyer business cards and erotic dvds.

     

    Do you think that FHCs could have their own section in personal stats?

    And if they are stored separately in the database (or they simply increase a booster counter in the database, in that case it would be impossible even for a developer to know how many fhcs a player used).

    Sounds like what you want is boosters to be divided into "energy", "nerve", and "other" categories.

    • Wolverine [1971836]
    • Role: Civilian
    • Level: 100
    • Posts: 5,177
    • Karma: 6,010
    • Last Action: 5 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 14:53:04 - 31/08/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Wolverine [1971836]

    Hi Splent,

    in our personal stats we see energy drinks, refills, alcohol, any different drug taken, but we don't see FHCs because they are included in the generic "boosters" category together with other stuff like lawyer business cards and erotic dvds.

     

    Do you think that FHCs could have their own section in personal stats?

    And if they are stored separately in the database (or they simply increase a booster counter in the database, in that case it would be impossible even for a developer to know how many fhcs a player used).

    JKyte [2417425]

    Sounds like what you want is boosters to be divided into "energy", "nerve", and "other" categories.

    no, I would like to FHC in "personal stas > Items" tab.

     

    We have Easter eggs found, Easter eggs used and Stat enhancers who are all boosters but have their own section, but we don't see FHC: why?

    Last edited by Wolverine on 14:55:22 - 31/08/24 (3 months ago)
    • byrod [1132772]
    • Role: Civilian
    • Level: 100
    • Posts: 2,528
    • Karma: 3,956
    • Last Action: 9 minutes
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 15:35:33 - 03/09/24 (3 months ago)
    Post link copied to clipboard Copy post link

    Suggestion type:

    New feature request / Minor Improvement

    What needs to be done: 

    Add new information in faction API section to indicate the faction is enlisted.
    This should only be available for the own faction via the AA permision.


    Why do you need this:
    The information is currently only available in the faction mainnews. Instead of pulling these regularly to check the news text, a simple flag could reduce the load on the API.
    Use case: We have an information dashboard to inform our members of the RW status, starting with the enlistment.

    Consider any drawbacks of your suggestion:

    No clear drawbacks to me.

    TornEngine

    • Bardicer [553834]
    • Role: Civilian
    • Level: 100
    • Posts: 718
    • Karma: 1,054
    • Last Action: 12 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 01:20:16 - 08/09/24 (2 months ago)
    Post link copied to clipboard Copy post link

    Suggestion type:
     - Minor improvement

     - Optimization / Performance

    What needs to be done:
     - Add attacker level and defender level to faction > attacks endpoint

    Why do you need this:
     - Currently the attack log object has the attacker and defender: name, id, faction id, and faction name.  If you want to also get their level, you currently need to make two additional API calls to the user > basic endpoint, one for each participant, just to get their level.

    Consider any drawbacks of your suggestion:

     - No real drawbacks, this is information that is already available in another endpoint, this suggestion just reduces the needed API calls by 66%, from 3 to 1.  Torn will likely save a little money.

    Example:

     "attacks": {
    "123": {
    "code": "a6032a48e3874f06ed004701511f5327",
    "timestamp_started": 1725714474,
    "timestamp_ended": 1725714475,
    "attacker_id": 3269692,
    "attacker_name": "Test1",
    "attacker_faction": 36691,
    "attacker_level": 100,
    "attacker_factionname": "Rabid Chihuahuas",
    "defender_id": 1785484,
    "defender_name": "Test2",
    "defender_faction": 16628,
    "defender_factionname": "Chain Reaction",
    "defender_level": 46,
    "result": "Lost",
    "stealthed": 0,
    "respect": 0,
    "chain": 0,
    "raid": 0,
    "ranked_war": 0,
    "respect_gain": 0,
    "respect_loss": 0,
    "modifiers": {
    "fair_fight": 1,
    "war": 1,
    "retaliation": 1,
    "group_attack": 1,
    "overseas": 1,
    "chain_bonus": 1,
    },
    }
    }

    Last edited by Bardicer on 01:22:08 - 08/09/24 (2 months ago)

     

     

     

     

     

    • Omanpx [1906686]
    • Role: Civilian
    • Level: 100
    • Posts: 2,388
    • Karma: 15,444
    • Last Action: 2 hours
      • 0
    • Reason:
      Are you sure you want to report this post to staff?
      Cancel
    Posted on 04:31:43 - 08/09/24 (2 months ago)
    Post link copied to clipboard Copy post link

    Bardicer [553834]

    Suggestion type:
     - Minor improvement

     - Optimization / Performance

    What needs to be done:
     - Add attacker level and defender level to faction > attacks endpoint

    Why do you need this:
     - Currently the attack log object has the attacker and defender: name, id, faction id, and faction name.  If you want to also get their level, you currently need to make two additional API calls to the user > basic endpoint, one for each participant, just to get their level.

    Consider any drawbacks of your suggestion:

     - No real drawbacks, this is information that is already available in another endpoint, this suggestion just reduces the needed API calls by 66%, from 3 to 1.  Torn will likely save a little money.

    Example:

     "attacks": {
    "123": {
    "code": "a6032a48e3874f06ed004701511f5327",
    "timestamp_started": 1725714474,
    "timestamp_ended": 1725714475,
    "attacker_id": 3269692,
    "attacker_name": "Test1",
    "attacker_faction": 36691,
    "attacker_level": 100,
    "attacker_factionname": "Rabid Chihuahuas",
    "defender_id": 1785484,
    "defender_name": "Test2",
    "defender_faction": 16628,
    "defender_factionname": "Chain Reaction",
    "defender_level": 46,
    "result": "Lost",
    "stealthed": 0,
    "respect": 0,
    "chain": 0,
    "raid": 0,
    "ranked_war": 0,
    "respect_gain": 0,
    "respect_loss": 0,
    "modifiers": {
    "fair_fight": 1,
    "war": 1,
    "retaliation": 1,
    "group_attack": 1,
    "overseas": 1,
    "chain_bonus": 1,
    },
    }
    }

    Don't think level is very relevant when it comes to attack info (when level holders are a thing), unless you are making a leveling list. Also not sure how many people pull that data alongside attack info. Sounds pretty specific for your use case and creates a bad precedence (what if i need their max hp or age?). 

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

    Guidebook - a collection of guides i made for Torn.

Reply
Thread Title: