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,
},
}
}