is there a way to see hits in a war just from an API call? I want to see who did how many hits specifically, but total hits is helpful too. Im wondering so i can further automate my google sheet.
Warring API Info
Started by dingus [3188789] on in API Development.
About this thread
Posts archived: 5 / 5 posts (100%) · the total is Torn's reply count + the opening post at the last fetch
Counted by TornLife from the archived posts.
- Archived posts
- 5
- Discussion span
- →
- People posting
- 5
- Likes on archived posts
- 5
- Posts by staff, officers and moderators
- 1
- Authority score
- 73 / 100
- Historical score
- 37 / 100
- Story score
- 31 / 100
- Engagement score
- 49 / 100
Most-liked replies
- splent [2088243] Admin
· 1 likes ·
Hey, Assuming you're talking about ranked wars, in general, you can get information about any ranked war on this endpoint: https://api.torn.com/torn/{id}?selections=rankedwarreport&key={yourKey} Given that you're a leader of a faction, you can get your faction's ranked wars like so: https://api.torn.com/faction/?selections=rankedwars&key={yourKey} You …
Hey,
Assuming you're talking about ranked wars, in general, you can get information about any ranked war on this endpoint:
https://api.torn.com/torn/{id}?selections=rankedwarreport&key={yourKey}
Given that you're a leader of a faction, you can get your faction's ranked wars like so:
https://api.torn.com/faction/?selections=rankedwars&key={yourKey}
You can also get detailed faction attacks on this endpoints:
https://api.torn.com/faction/?selections=attacks&key={yourKey}
Or less information, but more attacks here:
https://api.torn.com/faction/?selections=attacksfull&key={yourKey}
Feel free to explore the API docs here:
https://www.torn.com/api.html#
Given that you're a leader of a faction, you can get your faction's ranked wars like so...
Is it connected to being a leader, or more only related to having the faction AA permission.
I thought it was the latter, but now you made me wonder... :-)
Faction AA permission. Leader just has it by default.
This is what i do to do our faction reports:
- Get ongoing/latest war from /faction/?selections=rankedwars
- Use the start date to query /faction/?selections=attacks&from={startTimestamp}&to={endTimestamp}
- from and to fitlers by timestamp_ended in this case. So add a few seconds to it.
- If there are 100 attacks, i get the latest attacked sorted by timestamp_ended and use it as new from-query value
- After fetching all attacks i simply check the ranked_war-flag and boom, you got ALL the attacks for the ranked war.
- I would also include atacks with the chain-flag tho.. sometimes outside hits have to be made and that should be included imo
Side-Note: The bonuses are also included so you can do a very detailed overview of the war. If someone got a chain bonus the modifiers.chain_bonus is the bonus gained... e.g. 10, 25, etc. and can also be 1.10 in case of regular % bonus on "regular" chain hits.