Skip to content
TORNLIFE More

Attack Logs from faction-attacks API

Started by tonyuh [2093883] on in API Development.

7 replies · 346 views · thread synced · 9 days ago · View on torn.com
About this thread

Posts archived: 8 / 8 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
8
Discussion span
→
People posting
4
Likes on archived posts
3
Authority score
52 / 100
Historical score
30 / 100
Story score
40 / 100
Engagement score
55 / 100
tonyuh [2093883]

Hi there,

I'm new to all this but is there a way to get the attack log page from the API? The api itself only has attack_id but I have no idea how to convert that into a usable ID for the attacklog URL.

Thanks in advanced!
Kivou [2000607]

Not sure to understand the question but the attack_id is a key to a dictionary with attack info, like that:

"attacks": { "58084870": { "timestamp_started": 1541736671, "timestamp_ended": 1541736677, "attacker_id": 4, "attacker_name": "Duke", "attacker_faction": 0, "attacker_factionname": null, "defender_id": 1, "defender_name": "ched", "defender_faction": 33241, "defender_factionname": "Nub Navy", "result": "Lost", "stealthed": 0, "respect_gain": 0, "chain": 0, "modifiers": { "fairFight": 1, "war": 1, "retaliation": 1, "groupAttack": 1, "overseas": 1, "chainBonus": 1 } }, ...
tos [1976582]

Someone correct me if I am wrong here...

I don't think you can do what you are asking. Similar to the "random" market listing IDs I believe the attack IDs are just an incrementing counter which isn't directly tied to the listing/attack in game.
tonyuh [2093883]

Oh so if the attack is gone from the "recent attacks" window on the faction page there is no way to get the url to the attack log ever again?
tonyuh [2093883]

I was talking about getting the attack log url like this one "https://www.torn.com/loader.php?sid=attackLog&ID=74ec2707783499f4393a3e0114aaXXXX" from knowing the attack_id like the one you mentioned "58084870".
Tyler [23890]

Would be nice if they included the link in the recent attacks section. Sucks you can only see last 10 logs from warbase or whatever it's called now.
tos [1976582]

There are also a few of your own on the home page, still not great but slightly better than trying to get them from the faction page.