Main CS2 Inspect URL API class

Constructors

Methods

  • Creates an inspect URL from an EconItem

    Parameters

    Returns string

    The generated inspect URL

    Example

    const cs2 = new CS2Inspect();
    const item: EconItem = {
    defindex: WeaponType.AK_47,
    paintindex: 44, // Fire Serpent
    paintseed: 661,
    paintwear: 0.15
    };
    const url = cs2.createInspectUrl(item);
  • Decodes a MASKED inspect URL into an EconItem (synchronous, offline)

    ⚠️ ONLY works with MASKED URLs (URLs containing encoded protobuf data) ❌ Does NOT work with UNMASKED URLs (market/inventory links) - use inspectItem() instead

    Parameters

    • url: string

      The MASKED inspect URL to decode

    Returns EconItem

    The decoded item data

    Throws

    Error if URL is unmasked or invalid

    Example

    const cs2 = new CS2Inspect();
    // This works - masked URL with protobuf data
    const maskedUrl = "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20001807A8...";
    const item = cs2.decodeMaskedUrl(maskedUrl);

    // This will throw an error - unmasked URL
    const unmaskedUrl = "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198123456789A987654321D456789123";
    // cs2.decodeMaskedUrl(unmaskedUrl); // ❌ Throws error
  • Decodes a MASKED inspect URL into an EconItem (synchronous, offline)

    Parameters

    • url: string

      The MASKED inspect URL to decode

    Returns EconItem

    The decoded item data

    Deprecated

    Use decodeMaskedUrl() instead for clearer naming

  • Checks if a URL is a valid inspect URL

    Parameters

    • url: string

      The URL to check

    Returns boolean

    True if valid, false otherwise

    Deprecated

    Use analyzeUrl() and check for errors instead, or use validateUrl() for detailed validation

  • Normalizes an inspect URL to standard format

    Parameters

    • url: string

      The URL to normalize

    Returns string

    Normalized URL

  • Gets basic URL information without full decoding

    Parameters

    • url: string

      The URL to analyze

    Returns {
        type: "masked" | "unmasked" | "invalid";
        isQuoted: boolean;
        hasValidFormat: boolean;
        estimatedSize?: number;
    }

    Basic URL information

    • type: "masked" | "unmasked" | "invalid"
    • isQuoted: boolean
    • hasValidFormat: boolean
    • Optional estimatedSize?: number
  • Inspects ANY inspect URL (both masked and unmasked) - Universal method

    ✅ Works with MASKED URLs (decoded offline using protobuf data) ✅ Works with UNMASKED URLs (fetched via Steam client) 🔄 Automatically detects URL type and uses appropriate method

    Parameters

    • url: string

      Any valid inspect URL (masked or unmasked)

    Returns Promise<EconItem | SteamInspectResult>

    Promise resolving to the decoded item data

    Throws

    Error if Steam client is required but not available

    Example

    const cs2 = new CS2Inspect({
    steamClient: {
    enabled: true,
    username: 'your_username',
    password: 'your_password'
    }
    });
    await cs2.initializeSteamClient();

    // Works with masked URLs (offline)
    const maskedUrl = "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20001807A8...";
    const maskedItem = await cs2.inspectItem(maskedUrl);

    // Works with unmasked URLs (via Steam client)
    const unmaskedUrl = "steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20S76561198123456789A987654321D456789123";
    const unmaskedItem = await cs2.inspectItem(unmaskedUrl);
  • Inspects ANY inspect URL (both masked and unmasked) - Universal method

    Parameters

    • url: string

      Any valid inspect URL (masked or unmasked)

    Returns Promise<EconItem | SteamInspectResult>

    Promise resolving to the decoded item data

    Deprecated

    Use inspectItem() instead for clearer naming

  • Initialize Steam client for unmasked URL support

    Returns Promise<void>

    Promise that resolves when Steam client is ready

  • Check if Steam client is available and ready

    Returns boolean

    True if Steam client is ready for inspection

  • Get Steam client status and statistics

    Returns {
        status: SteamClientStatus;
        queueLength: number;
        isAvailable: boolean;
        unmaskedSupport: boolean;
    }

    Steam client status information

    • status: SteamClientStatus
    • queueLength: number
    • isAvailable: boolean
    • unmaskedSupport: boolean
  • Check if a URL requires Steam client for inspection

    Parameters

    • url: string

      The URL to check

    Returns boolean

    True if URL requires Steam client

  • Disconnect Steam client

    Returns Promise<void>

  • Updates the configuration

    Parameters

    Returns void