### GET https://www.tornstats.com/api/v1/{key}/battlestats/graph Source: https://tornstats.com/api Gets up to 3 months worth of stat data to build a graph. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/battlestats/graph ### Description Gets up to 3 months worth of stat data to build a graph out of. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/battlestats/graph ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **data** (array) - List of historical stat objects. #### Response Example { "status": true, "message": "Stats found.", "data": [] } ``` -------------------------------- ### GET /faction/roster Source: https://tornstats.com/api Display roster details about your faction. ```APIDOC ## GET https://www.tornstats.com/api/v2/{key}/faction/roster ### Description Display roster details about your faction. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/faction/roster ### Parameters #### Path Parameters - **key** (string) - Required - Your API key ### Response #### Success Response (200) - **status** (boolean) - Status of the request - **message** (string) - Response message - **members** (object) - Object containing roster details for each member ID ``` -------------------------------- ### GET /faction/skills Source: https://tornstats.com/api Displays skills for faction members or yourself if not in a faction. ```APIDOC ## GET https://www.tornstats.com/api/v2/{key}/faction/skills ### Description Displays skills for faction members or yourself if not in a faction. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/faction/skills ### Parameters #### Path Parameters - **key** (string) - Required - Your API key ### Response #### Success Response (200) - **status** (boolean) - Status of the request - **message** (string) - Response message - **members** (object) - Object containing skill levels for each member ID ``` -------------------------------- ### GET /api/v2/{key}/settings Source: https://tornstats.com/api Updates the player's preferences for comparing details on profiles. ```APIDOC ## GET /api/v2/{key}/settings ### Description Updates the player's preferences for comparing details on profiles. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/settings ### Parameters #### Query Parameters - **comparespy** (integer) - Optional - 1 or 0 to display spy details. - **comparepersonal** (integer) - Optional - 1 or 0 to display personal stats. - **personalstats** (string) - Optional - Comma separated string of API-friendly references to personal stats. ``` -------------------------------- ### GET /api/v2/{key}/spy/faction/{faction_id} Source: https://tornstats.com/api Loads profile details about a specific faction. ```APIDOC ## GET /api/v2/{key}/spy/faction/{faction_id} ### Description Loads profile details about the target faction. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/spy/faction/{faction_id} ### Parameters #### Path Parameters - **key** (string) - Required - The user API key. - **faction_id** (string) - Required - The ID of the faction. ``` -------------------------------- ### GET /api/v2/{key}/loot Source: https://tornstats.com/api Displays the current NPC loot timers. ```APIDOC ## GET /api/v2/{key}/loot ### Description Displays the current NPC loot timers. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/loot ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. ### Response #### Success Response (200) - **status** (boolean) - Operation status. - **message** (string) - Status message. - **[npc_id]** (object) - Details for each NPC including loot times. ``` -------------------------------- ### GET /faction/crimes Source: https://tornstats.com/api Displays relevant OC details about faction members. ```APIDOC ## GET https://www.tornstats.com/api/v2/{key}/faction/crimes ### Description Displays relevant OC details about faction members. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/faction/crimes ### Parameters #### Path Parameters - **key** (string) - Required - Your API key ### Response #### Success Response (200) - **status** (boolean) - Status of the request - **message** (string) - Response message - **members** (object) - Object containing crime stats for each member ID ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key}/settings Source: https://tornstats.com/api Updates the player's preferences for comparing details on profiles. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/settings ### Description Updates the player's preferences for comparing details on profiles. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/settings ### Parameters #### Query Parameters - **comparespy** (integer) - Optional - Decides whether to display the stat differences in spies (1/0). - **comparepersonal** (integer) - Optional - Decides whether to display personal stats (1/0). - **personalstats** (string) - Optional - Comma separated string of API-friendly references to personal stats. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - Confirmation message. #### Response Example { "status": true, "message": "Your settings have been updated!" } ``` -------------------------------- ### GET /api/v2/{key}/battlestats/record Source: https://tornstats.com/api Updates the player's battle stats and returns the gain since the last update. ```APIDOC ## GET /api/v2/{key}/battlestats/record ### Description Updates player's battle stats and returns the gain since last update. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/battlestats/record ### Parameters #### Path Parameters - **key** (string) - Required - The user API key. ### Response #### Success Response (200) - **age** (string) - Time since last update. - **status** (boolean) - Success status. - **message** (string) - Status message. - **deltaStrength** (number) - Change in strength. - **deltaDefense** (number) - Change in defense. - **deltaDexterity** (number) - Change in dexterity. - **deltaSpeed** (number) - Change in speed. ``` -------------------------------- ### GET /api/v2/{key} Source: https://tornstats.com/api Polls the Torn API to verify the account and update the Torn Stats API key if valid. ```APIDOC ## GET /api/v2/{key} ### Description Polls the Torn API to verify the account and update the Torn Stats API key if valid. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key} ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. ### Response #### Success Response (200) - **status** (boolean) - Operation status. - **message** (string) - Status message. ``` -------------------------------- ### GET /wars/{war_id} Source: https://tornstats.com/api Displays spy details for the rosters in a specific war. ```APIDOC ## GET https://www.tornstats.com/api/v2/{key}/wars/{war_id} ### Description Displays spy details for the rosters in a specific war. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/wars/{war_id} ### Parameters #### Path Parameters - **key** (string) - Required - Your API key - **war_id** (integer) - Required - The ID of the war ### Response #### Success Response (200) - **status** (boolean) - Status of the request - **message** (string) - Response message - **war** (object) - War details - **faction_a** (object) - Details for faction A - **faction_b** (object) - Details for faction B ``` -------------------------------- ### GET /api/v2/{key}/crime_pass_rates/show Source: https://tornstats.com/api Displays the personal Crime Pass Rates for the authenticated user. ```APIDOC ## GET /api/v2/{key}/crime_pass_rates/show ### Description Displays the personal Crime Pass Rates for the authenticated user. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/crime_pass_rates/show ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. ### Response #### Success Response (200) - **status** (boolean) - Operation status. - **message** (string) - Status message. - **crimes** (object) - Map of crime categories and their respective pass rates. ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key}/faction/roster Source: https://tornstats.com/api Retrieves roster details for the user's faction. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/faction/roster ### Description Display roster details about your faction. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/faction/roster ### Parameters #### Path Parameters - **key** (string) - Required - The user's Torn API key. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - Status message. - **members** (object) - Map of member IDs to their roster details. ### Response Example { "status": true, "message": "Member details found.", "members": { "776": { "name": "IceBlueFire", "total": 123456, "verified": 1 } } } ``` -------------------------------- ### GET https://www.tornstats.com/api/v2/{key}/battlestats/graph Source: https://tornstats.com/api Retrieves up to 3 months of battle stat data for graphing purposes. ```APIDOC ## GET https://www.tornstats.com/api/v2/{key}/battlestats/graph ### Description Gets up to 3 months worth of stat data to build a graph out of. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/battlestats/graph ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the request was successful. - **message** (string) - Status message. - **share_hof** (string) - Hall of fame share status. - **data** (array) - List of stat objects containing strength, defense, speed, dexterity, timestamp, and total. ``` -------------------------------- ### GET /api/v2/{key}/efficiency Source: https://tornstats.com/api Displays employee efficiency at every company position based on provided stats or the key owner's stats. ```APIDOC ## GET /api/v2/{key}/efficiency ### Description Displays employee efficiency at every company position based on provided stats or the key owner's stats. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/efficiency ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. #### Query Parameters - **man** (integer) - Optional - Manual labor stat. - **int** (integer) - Optional - Intelligence stat. - **end** (integer) - Optional - Endurance stat. ### Response #### Success Response (200) - **status** (boolean) - Operation status. - **message** (string) - Status message. - **stats** (object) - The stats used for calculation. ``` -------------------------------- ### GET /api/v2/{key}/hof/[1/0] Source: https://tornstats.com/api Updates the player's preference for participating in anonymous battle stats sharing. ```APIDOC ## GET /api/v2/{key}/hof/[1/0] ### Description Updates the player's preference of participating in sharing their battle stats anonymously. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/hof/[1/0] ### Parameters #### Path Parameters - **key** (string) - Required - The user API key. - **[1/0]** (integer) - Required - 1 to enable sharing, 0 to disable. ``` -------------------------------- ### GET https://www.tornstats.com/api/v2/{key}/events Source: https://tornstats.com/api Retrieves the latest events for the authenticated user. ```APIDOC ## GET https://www.tornstats.com/api/v2/{key}/events ### Description Displays your latest events on Torn Stats. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/events ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the request was successful. - **events** (array) - List of event objects containing timestamp, event description, and seen status. ``` -------------------------------- ### GET /api/v2/{key}/spy/user/{user_id} Source: https://tornstats.com/api Loads profile details about a specific target user. ```APIDOC ## GET /api/v2/{key}/spy/user/{user_id} ### Description Loads profile details about the target. Accepts the Torn ID or the Torn Name as the target. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/spy/user/{user_id} ### Parameters #### Path Parameters - **key** (string) - Required - The user API key. - **user_id** (string) - Required - The Torn ID or Name of the target. ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key}/spy/{target} Source: https://tornstats.com/api Loads profile details about the target, including spy data and personal stats. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/spy/{target} ### Description Loads profile details about the target. Accepts the Torn ID or the Torn Name as the target. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/spy/{target} ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. - **target** (string) - Required - The Torn ID or Torn Name of the target player. ### Response #### Success Response (200) - **compare** (object) - Contains spy data, personal stats, and attack history. #### Response Example { "compare": { "status": true, "data": {}, "timestamp": "1533752540", "spy": { "type": "faction-share", "status": true, "message": "Shared stats found." } } } ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key} Source: https://tornstats.com/api Polls the Torn API with the provided key to verify the account and update the Torn Stats user record. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key} ### Description Polls the Torn API with the key and checks to see if there's a matching account with the Torn ID on Torn Stats. This will update the User's API key with the one matching the request if the key is valid. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key} ### Parameters #### Path Parameters - **key** (string) - Required - The user's Torn API key. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - Status message regarding the account verification. ### Response Example { "status": true, "message": "User already exists. No action necessary." } ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key}/events Source: https://tornstats.com/api Retrieves the latest events for the user on Torn Stats. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/events ### Description Displays your latest events on Torn Stats. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/events ### Parameters #### Path Parameters - **key** (string) - Required - The user's Torn API key. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **events** (array) - List of event objects. ### Response Example { "status": true, "events": [ { "timestamp": 1613153932, "event": "IceBlueFire [776] has requested you take 1 member from JFK.", "seen": 1 } ] } ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key}/loot Source: https://tornstats.com/api Retrieves the current NPC loot times and status. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/loot ### Description Displays the NPC loot times. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/loot ### Parameters #### Path Parameters - **key** (string) - Required - The user's Torn API key. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - Status message. ### Response Example { "4": { "name": "DUKE", "torn_id": 4, "status": "Hospital", "hosp_out": 1616198996, "loot_2": 1616200796, "loot_3": 1616204396, "loot_4": 1616211596, "loot_5": 1616225996, "updated": 1616229508 }, "status": true, "message": "NPCs found." } ``` -------------------------------- ### GET /api/v2/{key}/faction/cpr Source: https://tornstats.com/api Displays Crime Pass Rates for faction members or the user if not in a faction. ```APIDOC ## GET /api/v2/{key}/faction/cpr ### Description Displays Crime Pass Rates for faction members or the user if not in a faction. ### Method GET ### Endpoint https://www.tornstats.com/api/v2/{key}/faction/cpr ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. ### Response #### Success Response (200) - **status** (boolean) - Operation status. - **message** (string) - Status message. - **members** (object) - Map of member IDs and their crime pass rates. ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key}/faction/crimes Source: https://tornstats.com/api Retrieves relevant Organized Crime (OC) details for faction members. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/faction/crimes ### Description Displays relevant OC details about faction members. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/faction/crimes ### Parameters #### Path Parameters - **key** (string) - Required - The user's Torn API key. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - Status message. - **members** (object) - Map of member IDs to their crime statistics. ### Response Example { "status": true, "message": "Member crime stats found.", "members": { "776": { "natural_nerve": 60, "crime_success": 9, "psych_degree": 1, "federal_judge": 1, "verified": 1 } } } ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key}/hof/[1/0] Source: https://tornstats.com/api Updates the player's preference for participating in anonymous battle stat sharing. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/hof/[1/0] ### Description Updates the player's preference of participating in sharing their battle stats anonymously. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/hof/[1/0] ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. - **[1/0]** (integer) - Required - 1 to enable sharing, 0 to disable. ### Response #### Success Response (200) - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - Confirmation message. #### Response Example { "status": true, "message": "You have turned sharing on! Thank you for participating anonymously." } ``` -------------------------------- ### GET https://www.tornstats.com/api/v1/{key}/battlestats/record Source: https://tornstats.com/api Updates the player's battle stats and returns the gain since the last update. ```APIDOC ## GET https://www.tornstats.com/api/v1/{key}/battlestats/record ### Description Updates player's battle stats and returns the gain since last update. ### Method GET ### Endpoint https://www.tornstats.com/api/v1/{key}/battlestats/record ### Parameters #### Path Parameters - **key** (string) - Required - The user's Torn API key. ### Response #### Success Response (200) - **age** (string) - Time since last update. - **status** (boolean) - Indicates if the operation was successful. - **message** (string) - Status message. - **deltaStrength** (number) - Change in strength. - **deltaDefense** (number) - Change in defense. - **deltaDexterity** (number) - Change in dexterity. - **deltaSpeed** (number) - Change in speed. ### Response Example { "age": "3 minutes ago", "status": true, "message": "Updated stats for 776", "deltaStrength": 0, "deltaDefense": 0, "deltaDexterity": 0, "deltaSpeed": 0 } ``` -------------------------------- ### Retrieve Battle Stat Graph Data Source: https://tornstats.com/api Fetches up to 3 months of historical battle stat data for visualization. ```json { "status": true, "message": "Stats found.", "share_hof": "1", "data": [ { "strength": 100, "defense": 100, "speed": 100, "dexterity": 100, "timestamp": 1525910400, "total": 400 }, { "strength": 130, "defense": 130, "speed": 100, "dexterity": 100, "timestamp": 1525996800, "total": 460 }, { "strength": 130, "defense": 130, "speed": 130, "dexterity": 100, "timestamp": 1526083200, "total": 520 }, { "strength": 130, "defense": 130, "speed": 130, "dexterity": 1000, "timestamp": 1526169600, "total": 1390 }, { "strength": 130, "defense": 130, "speed": 130, "dexterity": 1000, "timestamp": 1526256000, "total": 1390 } ] } ``` -------------------------------- ### POST /api/v1/{key}/store/spy Source: https://tornstats.com/api Saves spy data for a player. Requires specific faction permissions or assistant status to enter faction spies. ```APIDOC ## POST /api/v1/{key}/store/spy ### Description Saves spy data for a player. Requires specific faction permissions or assistant status to enter faction spies. ### Method POST ### Endpoint https://www.tornstats.com/api/v1/{key}/store/spy ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. #### Request Body - **player_id** (integer) - Required - The ID of the player. - **player_name** (string) - Required - The name of the player. - **player_level** (integer) - Required - The level of the player. - **strength** (integer) - Optional - Player strength stat. - **defense** (integer) - Optional - Player defense stat. - **speed** (integer) - Optional - Player speed stat. - **dexterity** (integer) - Optional - Player dexterity stat. - **total** (integer) - Optional - Player total stats. - **player_faction** (string) - Optional - Player faction name. ### Response #### Success Response (200) - **faction_entered** (boolean) - Indicates if faction spy was saved. - **personal_entered** (boolean) - Indicates if personal spy was saved. - **status** (boolean) - Operation status. - **message** (string) - Confirmation message. ``` -------------------------------- ### Retrieve Faction Member Skills Source: https://tornstats.com/api Returns skill levels for faction members or the authenticated user. ```json { "status": true, "message": "Faction member skills found.", "members": { "776": { "hunting": 96.27, "reviving": 100, "racing": 100, "bootlegging": 100, "burglary": 100, "graffiti": 100, "pickpocketing": 100, "search_for_cash": 100, "shoplifting": 100, "card_skimming": 100, "hustling": 100, "disposal": 100, "cracking": 100, "forgery": 100, "scamming": 100, "updated_at": "2024-10-13T23:37:16.000000Z" }, "778": { ... }, } } ``` -------------------------------- ### Retrieve Faction Roster Source: https://tornstats.com/api Provides details for members within the faction. ```json { "status": true, "message": "Member details found.", "members": { "776": { "name": "IceBlueFire", "total": 123456, "verified": 1 }, "790": { "name": "Shapeshifter", "total": 123456, "verified": 1 }, "2926": { "name": "Icy", "total": 123456, "verified": 1 }, } } ``` -------------------------------- ### Update Profile Comparison Settings Source: https://tornstats.com/api Updates user preferences for displaying spy details, stat differences, and personal stats on profiles. ```json { "status": true, "message": "Your settings have been updated!" } ``` -------------------------------- ### Retrieve Target Spy Details Source: https://tornstats.com/api Loads profile and spy details for a specific target using their Torn ID or name. ```json { "compare": { "status": true, "data": { "Xanax Taken": { "amount": 1245, "difference": 0 }, "Refills": { "amount": 164, "difference": 0 }, "Stat Enhancers Used": { "amount": 1, "difference": 0 }, "Merits Bought": { "amount": 10, "difference": 0 }, "Attacks Won": { "amount": 1654, "difference": 0 }, "Defends Won": { "amount": 45, "difference": 0 }, "Networth": { "amount": 100000000, "difference": 0 } }, "timestamp": "1533752540", "spy": { "type": "faction-share", "status": true, "message": "Shared stats found.", "target_score": 30.251259169, "your_score": 30.251259169, "fair_fight_bonus": 3, "difference": "18 hours ago", "strength": 100, "deltaStrength": 0, "defense": 100, "deltaDefense": 0, "speed": 100, "deltaSpeed": 0, "dexterity": 100, "deltaDexterity": 0, "total": 400, "deltaTotal": 0 }, "attacks": { "status": false, "message": "No recent attacks made against this player." } } } ``` -------------------------------- ### Verify Account API Key Source: https://tornstats.com/api Polls the Torn API to verify the provided key and link the account to Torn Stats. ```json { "status": true, "message": "User already exists. No action necessary." } ``` -------------------------------- ### Retrieve Faction Crime Stats Source: https://tornstats.com/api Returns organized crime details for faction members. ```json { "status": true, "message": "Member crime stats found.", "members": { "776": { "natural_nerve": 60, "crime_success": 9, "psych_degree": 1, "federal_judge": 1, "verified": 1 }, "1990": { "natural_nerve": 55, "crime_success": 0, "psych_degree": 1, "federal_judge": 1, "verified": 0 }, "456123": { "natural_nerve": 60, "crime_success": 0, "psych_degree": 1, "federal_judge": 0, "verified": 1 }, "123456": { "natural_nerve": 60, "crime_success": 10, "psych_degree": 1, "federal_judge": 1, "verified": 1 } } } ``` -------------------------------- ### Retrieve Faction Spy Data Source: https://tornstats.com/api Loads profile details for a faction, including member statistics and faction information. ```json { "status": true, "message": "Spy data found.", "faction": { "ID": 8989, "name": "JUX HQ", "tag": "JUX", "tag_image": "8989-31756.png", "leader": 271665, "co-leader": 1629262, "respect": 6821922, "age": 4843, "capacity": 100, "best_chain": 25000, "territory_wars": [], "raid_wars": [], "peace": [], "rank": { "level": 3, "name": "Bronze", "division": 1, "position": 0 }, "members": { "790": { "name": "Shapeshifter", "level": 79, "days_in_faction": 439, "last_action": { "status": "Offline", "timestamp": 1642453772, "relative": "54 minutes ago" }, "status": { "description": "Okay", "details": "", "state": "Okay", "color": "green", "until": 0 }, "position": "Step Sibling", "id": 790, "personalstats": { "Xanax Taken": 469, "Stat Enhancers Used": 1, "Refills": 15, "Attacks Won": 675, "Defends Won": 95, "Networth": 7586851691, "Defends Lost": 1243, "Elo Rating": 1387, "timestamp": 1627302167 } }, ... } ``` -------------------------------- ### Save Spy Data Source: https://tornstats.com/api Submit player spy statistics. Requires specific faction permissions or assistant status. ```json { "faction_entered": true, "personal_entered": true, "status": true, "message": "Spy has been saved. Stats have been updated for IceBlueFire in JFK's spies. Stats have been updated for IceBlueFire in JFK 2.1's spies. Stats have been updated for IceBlueFire in your personal spies." } ``` -------------------------------- ### Retrieve War Spy Details Source: https://tornstats.com/api Returns spy data for rosters involved in a specific war. ```json { "status": true, "message": "War data found.", "war": { "id": 243, "war_id": 337, "faction_a_id": 21041, "faction_a_name": "URANUS", "faction_a_score": 2388, "faction_a_chain": 0, "faction_b_id": 37933, "faction_b_name": "Sell Swords", "faction_b_score": 2079, "faction_b_chain": 0, "start": 1642784400, "start_at": "2022-01-21T17:00:00.000000Z", "end": 0, "end_at": "-000001-11-30T00:00:00.000000Z", "target": 1110, "winner": 0, "created_at": "2022-01-19T09:01:02.000000Z", "updated_at": "2022-01-25T14:27:02.000000Z", "faction_a_reward_respect": 0, "faction_a_reward_points": 0, "faction_a_end_rank": null, "faction_b_reward_respect": 0, "faction_b_reward_points": 0, "faction_b_end_rank": null }, "faction_a": { "ID": 21041, "name": "URANUS", "tag": "URNS", "tag_image": "21041-92649.png", "leader": 2425885, "co-leader": 0, "respect": 64318, "age": 3805, "capacity": 25, "best_chain": 58, "territory_wars": [], "raid_wars": [], "peace": [], "rank": { "level": 1, "name": "Unranked", "division": 0, "position": 0 }, "members": { ... } }, "faction_b": { "ID": 37933, "name": "Sell Swords", "tag": "S/S", "tag_image": "37933-32820.png", "leader": 2144083, "co-leader": 2148320, "respect": 143361, "age": 1853, "capacity": 40, "best_chain": 100, "territory_wars": [], "raid_wars": [], "peace": [], "rank": { "level": 2, "name": "Bronze", "division": 0, "position": 0 }, "members": { ... } } } ``` -------------------------------- ### POST https://www.tornstats.com/api/v2/{key}/store/spy Source: https://tornstats.com/api Stores spy data for a player. Requires specific permissions for faction spies. ```APIDOC ## POST https://www.tornstats.com/api/v2/{key}/store/spy ### Description Stores spy data for a player. To enter faction spies, the user must have the faction permission (API Save Spies) or be a Faction Assistant or above. ### Method POST ### Endpoint https://www.tornstats.com/api/v2/{key}/store/spy ### Parameters #### Path Parameters - **key** (string) - Required - The API key for authentication. #### Request Body - **player_id** (integer) - Required - The ID of the player. - **player_name** (string) - Required - The name of the player. - **player_level** (integer) - Required - The level of the player. - **strength** (integer) - Optional - Player strength. - **defense** (integer) - Optional - Player defense. - **speed** (integer) - Optional - Player speed. - **dexterity** (integer) - Optional - Player dexterity. - **total** (integer) - Optional - Total stats. - **player_faction** (string) - Optional - Player faction name. - **timestamp** (integer) - Optional - Time of the spy report. ### Response #### Success Response (200) - **faction_entered** (boolean) - Whether the data was entered into faction spies. - **personal_entered** (boolean) - Whether the data was entered into personal spies. - **status** (boolean) - Indicates if the request was successful. - **message** (string) - Confirmation message. ``` -------------------------------- ### Retrieve Employee Efficiency Source: https://tornstats.com/api Calculate employee efficiency for company positions based on work stats. ```json { "1": { "company": "Hair Salon", "Stylist": 165, "Colorist": 161, "Nail Technician": 165, "Apprentice": 181, "Shampooist": 171, "Senior Stylist": 155, "Receptionist": 157, "Trainer": 149, "Aesthetician": 149 }, ... "stats": { "manual_labor": 100000, "intelligence": 100000, "endurance": 300000 }, "status": true, "message": "Retrieving employee efficiency with assumed education completed." } ``` -------------------------------- ### Retrieve NPC Loot Times Source: https://tornstats.com/api Displays current NPC status and upcoming loot times. ```json { "4": { "name": "DUKE", "torn_id": 4, "status": "Hospital", "hosp_out": 1616198996, "loot_2": 1616200796, "loot_3": 1616204396, "loot_4": 1616211596, "loot_5": 1616225996, "updated": 1616229508 }, "15": { "name": "Leslie", "torn_id": 15, "status": "Hospital", "hosp_out": 1616202508, "loot_2": 1616204308, "loot_3": 1616207908, "loot_4": 1616215108, "loot_5": 1616229508, "updated": 1616229508 }, "19": { "name": "Jimmy", "torn_id": 19, "status": "Okay", "hosp_out": 1616195003, "loot_2": 1616196803, "loot_3": 1616200403, "loot_4": 1616207603, "loot_5": 1616222003, "updated": 1616229508 }, "20": { "name": "Fernando", "torn_id": 20, "status": "Okay", "hosp_out": 1616195488, "loot_2": 1616197288, "loot_3": 1616200888, "loot_4": 1616208088, "loot_5": 1616222488, "updated": 1616229508 }, "status": true, "message": "NPCs found." } ``` -------------------------------- ### Retrieve Faction Crime Pass Rates Source: https://tornstats.com/api Fetch crime pass rates for faction members or the authenticated user. ```json { "status": true, "message": "Fetching faction CPR results.", "members": { "776": { "Blast from the Past": { "Picklock": 87, "Hacker": 87, "Engineer": 86, "Bomber": 100, "Muscle": 87 }, "Break the Bank": { "Robber": 75, "Muscle": 75, "Thief": 74 } } } } ``` -------------------------------- ### Retrieve Personal Crime Pass Rates Source: https://tornstats.com/api Fetch personal crime pass rates for various crime categories. ```json { "status": true, "message": "Fetching CPR results.", "crimes": { "Blast from the Past": { "Picklock": 87, "Hacker": 87, "Engineer": 86, "Bomber": 100, "Muscle": 87 }, "Break the Bank": { "Robber": 75, "Muscle": 75, "Thief": 74 } } } ``` -------------------------------- ### Retrieve User Events Source: https://tornstats.com/api Fetches the latest events recorded on Torn Stats for the user. ```json { "status": true, "events": [ { "timestamp": 1613153932, "event": "IceBlueFire [776] has requested you take 1 member from JFK.", "seen": 1 }, { "timestamp": 1613153901, "event": "IceBlueFire [776] has requested you take 2 members from JFK.", "seen": 1 } ] } ``` -------------------------------- ### Update Battle Stats Record Source: https://tornstats.com/api Triggers a battle stats update and returns the delta since the last recorded entry. ```json { "age": "3 minutes ago", "status": true, "message": "Updated stats for 776", "deltaStrength": 0, "deltaDefense": 0, "deltaDexterity": 0, "deltaSpeed": 0 } ``` -------------------------------- ### Update Hall of Fame Participation Source: https://tornstats.com/api Updates the player's preference for sharing battle stats anonymously in the Hall of Fame. ```json { "status": true, "message": "You have turned sharing on! Thank you for participating anonymously." } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.