### Install SteamID Module Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Install the steamid module from npm. Requires Node.js version 12 or later. ```bash $ npm install steamid ``` -------------------------------- ### Get SteamID64 as String Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Retrieve the 64-bit representation of the SteamID as a string. This is an alias for the toString() method. ```javascript const SteamID = require('steamid'); let sid = new SteamID('[g:1:4681548]'); console.log(sid.getSteamID64()); // "103582791434202956" let sid2 = new SteamID('STEAM_0:0:23071901'); console.log(sid2.getSteamID64()); // "76561198006409530" ``` -------------------------------- ### Get SteamID64 as BigInt Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Retrieve the 64-bit representation of the SteamID as a BigInt. This is useful for precise handling of large numbers. ```javascript const SteamID = require('steamid'); let sid = new SteamID('[g:1:4681548]'); console.log(sid.getBigIntID()); // 103582791434202956n let sid2 = new SteamID('STEAM_0:0:23071901'); console.log(sid2.getBigIntID()); // n76561198006409530n ``` -------------------------------- ### Get Steam2 Rendered ID Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Retrieve the Steam2 rendered ID format for an individual account. Throws an error if the type is not individual. An optional boolean argument can be passed to use the newer format (1 instead of 0 for the public universe). ```javascript const SteamID = require('steamid'); let sid = new SteamID('76561198006409530'); console.log(sid.getSteam2RenderedID()); // STEAM_0:0:23071901 console.log(sid.getSteam2RenderedID(true)); // STEAM_1:0:23071901 ``` -------------------------------- ### Get Steam3 Rendered ID Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Retrieve the Steam3 rendered ID format for a SteamID. This method works for various SteamID types, including individual accounts and groups. ```javascript const SteamID = require('steamid'); let sid = new SteamID(76561198006409530n); console.log(sid.getSteam3RenderedID()); // [U:1:46143802] let gid = new SteamID(103582791434202956n); console.log(gid.getSteam3RenderedID()); // [g:1:4681548] ``` -------------------------------- ### Create SteamID from Parts Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Construct a SteamID object by manually setting its universe, type, instance, and account ID. Requires the 'steamid' module. ```javascript const SteamID = require('steamid'); let sid = new SteamID(); sid.universe = SteamID.Universe.PUBLIC; sid.type = SteamID.Type.INDIVIDUAL; sid.instance = SteamID.Instance.DESKTOP; sid.accountid = 46143802; ``` -------------------------------- ### Create Individual SteamID Shorthand Source: https://github.com/doctormckay/node-steamid/blob/master/README.md A convenient method to create an individual SteamID with the desktop instance in the public universe, given only the account ID. Requires the 'steamid' module. ```javascript const SteamID = require('steamid'); let sid = SteamID.fromIndividualAccountID(46143802); ``` -------------------------------- ### SteamID Constructor Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Creates a new SteamID object. It can be initialized with a Steam2 rendered ID, a Steam3 rendered ID, a SteamID64, or by setting its universe, type, instance, and account ID properties. ```APIDOC ## SteamID Constructor ### Description Creates a new SteamID object. It can be initialized with a Steam2 rendered ID, a Steam3 rendered ID, a SteamID64, or by setting its universe, type, instance, and account ID properties. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```js const SteamID = require('steamid'); // From Steam2 ID let sid1 = new SteamID('STEAM_0:0:23071901'); // From Steam3 ID let sid2 = new SteamID('[U:1:46143802]'); // From SteamID64 (string) let sid3 = new SteamID('76561198006409530'); // From SteamID64 (BigInt) let sid4 = new SteamID(76561198006409530n); // From parts let sid5 = new SteamID(); sid5.universe = SteamID.Universe.PUBLIC; sid5.type = SteamID.Type.INDIVIDUAL; sid5.instance = SteamID.Instance.DESKTOP; sid5.accountid = 46143802; ``` ### Response #### Success Response (200) Returns a SteamID object. #### Response Example ```json { "example": "SteamID object" } ``` ``` -------------------------------- ### SteamID.fromIndividualAccountID() Source: https://github.com/doctormckay/node-steamid/blob/master/README.md A shorthand method for creating an individual SteamID with the desktop instance in the public universe, given only an account ID. ```APIDOC ## SteamID.fromIndividualAccountID(accountID) ### Description A shorthand method for creating an individual SteamID with the desktop instance in the public universe, given only an account ID. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **accountID** (number) - Required - The account ID to create the SteamID from. ### Request Example ```js const SteamID = require('steamid'); let sid = SteamID.fromIndividualAccountID(46143802); ``` ### Response #### Success Response (200) Returns a SteamID object representing an individual user. #### Response Example ```json { "example": "SteamID object" } ``` ``` -------------------------------- ### Create SteamID from SteamID64 Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Instantiate a SteamID object using its 64-bit identifier. Supports both string and BigInt formats. Requires the 'steamid' module. ```javascript const SteamID = require('steamid'); let sid = new SteamID('76561198006409530'); // Or you can use a BigInt; new in steamid@2.0.0 let sid2 = new SteamID(76561198006409530n); ``` -------------------------------- ### getSteamID64() Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Returns the 64-bit representation of the SteamID, as a string. Alias: `toString()`. ```APIDOC ## getSteamID64() ### Description Returns the 64-bit representation of the SteamID, as a string. Alias: `toString()`. ### Parameters None ### Request Example ```js const SteamID = require('steamid'); let sid = new SteamID('[g:1:4681548]'); console.log(sid.getSteamID64()); // "103582791434202956" let sid2 = new SteamID('STEAM_0:0:23071901'); console.log(sid2.getSteamID64()); // "76561198006409530" ``` ### Response #### Success Response (200) - **steamID64** (string) - The 64-bit SteamID as a string. #### Response Example ```json { "example": "103582791434202956" } ``` ``` -------------------------------- ### Create SteamID from Steam3 ID Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Instantiate a SteamID object using its Steam3 rendered format. Requires the 'steamid' module. ```javascript const SteamID = require('steamid'); let sid = new SteamID('[U:1:46143802]'); ``` -------------------------------- ### Create SteamID from Steam2 ID Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Instantiate a SteamID object using its Steam2 rendered format. Requires the 'steamid' module. ```javascript const SteamID = require('steamid'); let sid = new SteamID('STEAM_0:0:23071901'); ``` -------------------------------- ### getBigIntID() Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Returns the 64-bit representation of the SteamID, as a BigInt. ```APIDOC ## getBigIntID() ### Description Returns the 64-bit representation of the SteamID, as a BigInt. ### Parameters None ### Request Example ```js const SteamID = require('steamid'); let sid = new SteamID('[g:1:4681548]'); console.log(sid.getBigIntID()); // 103582791434202956n let sid2 = new SteamID('STEAM_0:0:23071901'); console.log(sid2.getBigIntID()); // 76561198006409530n ``` ### Response #### Success Response (200) - **bigIntID** (BigInt) - The 64-bit SteamID as a BigInt. #### Response Example ```json { "example": "103582791434202956n" } ``` ``` -------------------------------- ### getSteam2RenderedID([newerFormat]) Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Returns the Steam2 rendered ID format for individual accounts. Throws an error if the type isn't individual. If `true` is passed for `newerFormat`, the first digit will be 1 instead of 0 for the public universe. ```APIDOC ## getSteam2RenderedID([newerFormat]) ### Description Returns the Steam2 rendered ID format for individual accounts. Throws an error if the type isn't individual. If `true` is passed for `newerFormat`, the first digit will be 1 instead of 0 for the public universe. ### Parameters * **newerFormat** (boolean) - Optional - If true, uses the newer format (starting with 1 for public universe). ### Request Example ```js const SteamID = require('steamid'); let sid = new SteamID('76561198006409530'); console.log(sid.getSteam2RenderedID()); // STEAM_0:0:23071901 console.log(sid.getSteam2RenderedID(true)); // STEAM_1:0:23071901 ``` ### Response #### Success Response (200) - **steam2RenderedID** (string) - The Steam2 rendered ID. #### Response Example ```json { "example": "STEAM_0:0:23071901" } ``` ``` -------------------------------- ### SteamID Instance Enum Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Defines the instances associated with a SteamID, such as desktop, console, or web. ```javascript SteamID.Instance = { ALL: 0, DESKTOP: 1, CONSOLE: 2, WEB: 4 }; ``` -------------------------------- ### isLobby() Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Returns `true` if the `type` of this SteamID is `CHAT`, and it's associated with a Steam lobby. ```APIDOC ## isLobby() ### Description Returns `true` if the `type` of this SteamID is `CHAT`, and it's associated with a Steam lobby. ### Parameters None ### Request Example ```js const SteamID = require('steamid'); // Assuming sid is a SteamID object representing a lobby // console.log(sid.isLobby()); // true ``` ### Response #### Success Response (200) - **isLobby** (boolean) - True if the SteamID represents a lobby, false otherwise. #### Response Example ```json { "example": true } ``` ``` -------------------------------- ### isValid() Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Returns whether Steam would consider a given ID to be "valid". This does not check whether the given ID belongs to a real account that exists, nor does it check that the given ID is for an individual account or in the public universe. ```APIDOC ## isValid() ### Description Returns whether Steam would consider a given ID to be "valid". This does not check whether the given ID belongs to a real account that exists, nor does it check that the given ID is for an individual account or in the public universe. ### Parameters None ### Request Example ```js const SteamID = require('steamid'); let sid = new SteamID('STEAM_0:0:23071901'); console.log(sid.isValid()); // true ``` ### Response #### Success Response (200) - **isValid** (boolean) - True if the SteamID is considered valid by Steam, false otherwise. #### Response Example ```json { "example": true } ``` ``` -------------------------------- ### isValidIndividual() Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Returns whether this SteamID is valid and belongs to an individual user in the public universe with a desktop instance. This is what most people think of when they think of a SteamID. Does not check whether the account actually exists. ```APIDOC ## isValidIndividual() ### Description Returns whether this SteamID is valid and belongs to an individual user in the public universe with a desktop instance. This is what most people think of when they think of a SteamID. Does not check whether the account actually exists. ### Parameters None ### Request Example ```js const SteamID = require('steamid'); let sid = new SteamID('76561198006409530'); console.log(sid.isValidIndividual()); // true ``` ### Response #### Success Response (200) - **isValidIndividual** (boolean) - True if the SteamID is a valid individual account, false otherwise. #### Response Example ```json { "example": true } ``` ``` -------------------------------- ### SteamID Universe Enum Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Defines the different universes available for SteamIDs. The public universe is the most commonly used. ```javascript SteamID.Universe = { INVALID: 0, PUBLIC: 1, BETA: 2, INTERNAL: 3, DEV: 4 } ``` -------------------------------- ### getSteam3RenderedID() Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Returns the Steam3 rendered ID format. ```APIDOC ## getSteam3RenderedID() ### Description Returns the Steam3 rendered ID format. ### Parameters None ### Request Example ```js const SteamID = require('steamid'); let sid = new SteamID(76561198006409530n); console.log(sid.getSteam3RenderedID()); // [U:1:46143802] let gid = new SteamID(103582791434202956n); console.log(gid.getSteam3RenderedID()); // [g:1:4681548] ``` ### Response #### Success Response (200) - **steam3RenderedID** (string) - The Steam3 rendered ID. #### Response Example ```json { "example": "[U:1:46143802]" } ``` ``` -------------------------------- ### isGroupChat() Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Returns `true` if the `type` of this SteamID is `CHAT`, and it's associated with a Steam group's chat room. ```APIDOC ## isGroupChat() ### Description Returns `true` if the `type` of this SteamID is `CHAT`, and it's associated with a Steam group's chat room. ### Parameters None ### Request Example ```js const SteamID = require('steamid'); // Assuming sid is a SteamID object representing a group chat // console.log(sid.isGroupChat()); // true ``` ### Response #### Success Response (200) - **isGroupChat** (boolean) - True if the SteamID represents a group chat, false otherwise. #### Response Example ```json { "example": true } ``` ``` -------------------------------- ### SteamID Type Enum Source: https://github.com/doctormckay/node-steamid/blob/master/README.md Defines the various types of entities a SteamID can represent, such as individual users, clans, or game servers. ```javascript SteamID.Type = { INVALID: 0, INDIVIDUAL: 1, MULTISEAT: 2, GAMESERVER: 3, ANON_GAMESERVER: 4, PENDING: 5, CONTENT_SERVER: 6, CLAN: 7, CHAT: 8, P2P_SUPER_SEEDER: 9, ANON_USER: 10 } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.