Torn API
What TornLife's research has established about Torn API, and the questions players asked about it.
What TornLife has verified
- Since Feb 2025 API v2 has 'torn' -> 'attacklog' for full attack logs. Large group fights are best fetched via '_metadata' links, at 100 rows per request though not always. Stealth attacks always hide the attacker, even from the attacker. A 'user' -> 'attacklog' selection was not created. (confirmed by Torn; Upcoming API changes, )
- The older 'attacks' API selections cannot process full logs, so results such as Interrupted can be inaccurate there. The attacklog selection was built to allow accurate processing. (confirmed by Torn; Attack missing from war report, )
- The Torn API has a 'battlestats' selection under /user/ that returns the four individual battle stats; a player reported in 2016 that the endpoint https://api.torn.com/user/?selections=battlestats&key= returned Strength, Speed, Defense and Dexterity but no combined total, and the developer confirmed this was an oversight, not by design, and added a total field. (confirmed by Torn; [API] No total on battle stats, )
- The wiki defines Battle Stats as Strength, Speed, Defense and Dexterity, the stats used when attacking other players, each with a distinct combat effect (damage dealt, chance to hit, damage reduction, dodge/stealth/escape chances). (documented; Battle Stats › Basic Info, )
- The API's battle stats number formatting changed in 2020 from plain digits (e.g. "4000000") to comma-separated ("4,000,000"), which broke third-party tools (TornTools awards display, TornStats' battle stats graphs) that parsed the raw string with parseInt() without stripping commas; staff treated it as a non-bug and closed the report without reverting. (confirmed by Torn; API Battle stats formatting changed, )
- The wiki's Preferences page describes the API key section as the place a player finds their own key, described generically as useful for third-party apps like Torn Stats and DoctorN, with a separate wiki page giving more detail on the API itself; this capture gives no specifics on access levels or battle-stat exposure. (documented; Preferences › API Key, )
- Staff bug reports confirm the API key system has had operational issues unrelated to battle-stat content specifically: public keys briefly all returned error code 16 in December 2021 (while limited keys were unaffected) and were fixed same day, and a 2024 report flagged that paused API keys still consume rate-limit quota, passed to a developer for checking with no resolution text captured. (confirmed by Torn; Paused API Keys Consume API Rate Limit Quota, )
- The wiki's Battle Stat Weights table (captured 2023-08) gives the full speed-vs-10,000,000-dexterity hit-chance curve and defense-vs-10,000,000-strength damage-mitigation curve, from 156,250 speed (0% hit chance) up to 640,000,000 speed (100% hit chance), and 312,500 defense (0% mitigation) up to 140,000,000 defense (100% mitigation); this is a combat-formula table, not an API data field. (documented; Battle Stats › Stat Weights — Battle Stat Weights, )
- Torn's API access-level system gates even data that is otherwise shown publicly on a player's profile: in December 2021 a player reported that fetching another user's criminal record via the 'crimes' selection with a public-access-only key returned an 'Access level of this key is not high enough' error, despite the record being visible on that player's public personalstats page; a developer acknowledged it. (confirmed by Torn; Api Key incorrect "access level" error, )
- A March 2026 bug report alleged a stealth attacker's identity, which the in-game UI masks, could be exposed via the API/a Discord bot; staff reported a developer checked and confirmed the attacker ID is not leaked for stealth attacks anywhere, and asked for a reproducible API example if disputed. (confirmed by Torn; [API Leak] Stealth Attacker Identity Exposed via API / Discord Bot, )
- Torn staff has repeatedly fielded basic API-key bug reports (e.g. a 2021 report that the preferences page did not display a player's own API key, and 2022/2025 reports forwarded to developers without public resolution detail) and warned against selling API keys, calling a seller's use of multiple accounts to vouch for a 'selling API keys' post 'kinda hilarious'. (player reports; Selling API keys, )
- The wiki's Personal Stats comparing-stats feature groups Battle Stats (Strength, Defense, Speed, Dexterity, Total battle stats) and Total working stats (Manual labor, Intelligence, Endurance) under a 'Private Statistics' category, alongside Trading and Investments, indicating these stats are privacy-controlled rather than always publicly visible. (documented; Personal Stats › Comparing Stats › Private Statistics, )
- The Torn Wiki's API error-code list (captured 2020-11-01) documents error 16 as 'Access level of this key is not high enough: A selection is being called of which this key does not have permission to access,' confirming a tiered access-level system gates which selections a key can call. (documented; API › Error codes, )
- The same wiki error-code list documents error 7 as 'Incorrect ID-entity relation: A requested selection is private (For example, personal data of another user / faction),' confirming that some selections return this error when queried for another player's ID rather than the key owner's own. (documented; API › Error codes, )
- The wiki's general API intro shows data is pulled via /user/?selections=<name>&key=<APIKEY>, with example selections 'skills' and 'networth'; an unauthenticated lookup selection call lists which selections exist, implying the selection list is self-documenting per key. (documented; API › Details, )
Questions about Torn API
- Does the Torn API expose a player's exact battle stats, and if so, under what access conditions?
Yes — a player's own exact battle stats (Strength, Speed, Defense, Dexterity, plus Total) can be pulled through the API's 'battlestats' selection or …
- How do you download and use the CityWatch tool for Torn?
CityWatch was a standalone desktop app (Windows .exe / Mac .dmg), bought and installed through Torn's Points building page, used after installing Jav…
- Is there a way to view the full attack log in Torn?
Torn has no single page listing every attack, but each attack has its own log, and the full history is available through the Activity Log and the API…
Combat ·