Hi everyone, I'm trying to figure our how to make ranked war log similar to chain log (https://api.torn.com/faction/?selections=chains) since there is no rankedwars selection under faction endpoint. I tried to use https://api.torn.com/torn/?selections=rankedwars but for some reasons some ranked wars are missing from this selection so my faction's ranked war is missing (forexample rw id 6364).
Is there a way to query just ranked wars for a single faction similar to when you filter for your faction in Faction Warfare page?
There is a rankedearreport section under torn - use your war id as the ID part of the call, like torn/6364?selections=rankedwarreport. Or just use this :)
https://www.torn.com/forums.php#/p=threads&f=67&t=16306621&b=0&a=0
Mentions:
[Website] Debriefing - Extended War Reports + AI
Thank you, but that doesn't solve my issue because I don't know the war ID in the first place (I looked up 6364 manually from the faction page). Without the rw log api, how do I get all war ID related to my faction from the API?
Oh, i'm pretty sure you can't get older war report IDs using torn/rankedwars. I don't think from / to or timestamp work on this selection - it lists all ONGOING ranked wars (and recently finished). Here is a link to more info:
https://tornapi.tornplayground.eu/torn/rankedwars
That's what I'm afraid is the case, thanks for your help anyway. I guess I'll just have to periodically save current RW in a database to have all past RW infos.
It's probably easier to just do it manually once a month or after each war - at least save the war IDs from the page for use later.
Correct me if I'm wrong, but "from/to" doesn't work with the "mainnews" api:
https://api.torn.com/faction/?selections=mainnews&from=1691527023&to=1691529730&key=MYAPIKEY
I was hoping to get the ranked war reports from there...
It does, you might just be using the wrong date?
[image: i.imgur.com]
you are right, there is an issue for which I have to decrease "to" parameter instead of increasing "from" parameter to get the next 100 items: now that I do that I can get multiples of 100 mainnews in any timespan range.
Thanks to Omanpx's help I made what you require:
you can use
https://api.torn.com/faction/?selections=mainnews&key=
to search for mainnews with the text "rankID=" like this one:
<a class="t-green bold" href = http://www.torn.com/factions.php?step=profile&ID=26437>The Pagans</a> defeated <a class="t-red bold" href = http://www.torn.com/factions.php?step=profile&ID=15222>Carbon Rising</a> in a ranked war [<a href = http://www.torn.com/war.php?step=rankreport&rankID=7485>view</a>]
I repeat the mainnews call every 35 seconds to get different sets of 100 mainnews from a timestamp to another timestamp.
Once you have the rankID then you can call
https://api.torn.com/torn/7485?selections=rankedwarreport&key=
to get the details about the war report with that rankID.
Real . . .