steam-user
A Rust library for HTTP-based interactions with Steam Community web endpoints, providing functionality for mobile confirmations, profile management, market operations, and more.
Features
- Mobile Confirmations - Accept/cancel trade and market confirmations
- Two-Factor Authentication - Enable/disable Steam Guard, generate backup codes, deauthorize devices
- Profile Management - Edit profile settings, privacy options, avatars, and nicknames
- Market Operations - Create listings, search items, calculate gem values
- Inventory Access - Fetch user inventories and item details
- Group Management - Join groups, accept/decline invites
- User Interactions - Post comments, invite to groups, search users
- Comment Management - Post, delete, and list profile comments with detailed author info
- Account Details - Retrieve wallet balance, email, country, and security status
- Wallet & Spending - Get precise wallet balance, currency, and total amount spent on Steam
- Phone Number Management - Add, confirm, and remove phone numbers
- Token Management - Enumerate active refresh tokens, verify existence, and revoke tokens
- Trade Management - Send/accept/decline trade offers, parse and retrieve trade URLs
- License Management - Add free game licenses and sub packages
- Loyalty Rewards - Redeem Steam Points for community items and profile rewards
- Steam App Management - Get owned apps, fetch app details, and CS:GO account stats
- File Uploads - Upload images for chat and specific use cases
- Match History - Retrieve CS:GO/CS2 match history with player stats, scores, and GOTV replays
- Help Requests - List active/past support tickets and view conversation details
- Player Reports - Retrieve history of reported players
Installation
Add to your Cargo.toml:
[]
= { = "../steam-user" }
Feature Flags
| Feature | Default | Description |
|---|---|---|
remote |
❌ | Enables RemoteSteamUser, an HTTP client that delegates to a steam-user-api REST server |
# Enable the remote client
= { = "../steam-user", = ["remote"] }
Usage
Basic Setup
use SteamUser;
async
Mobile Confirmations
use SteamUser;
// Fetch pending confirmations (tag defaults to "conf" if None)
let confirmations = community.get_confirmations.await?;
// Get the object ID (e.g., Trade Offer ID) for a confirmation
// This scrapes the details page
if let Some = community.get_confirmation_offer_id.await?
// Accept a confirmation
community.respond_to_confirmation.await?;
// Convenience: Accept/Deny for a specific object (trade/market ID)
community.accept_confirmation_for_object.await?;
community.deny_confirmation_for_object.await?;
Two-Factor Authentication
// Enable 2FA (initiates setup, sends SMS)
let resp = community.add_authenticator.await?;
// Or using the high-level method name from FEATURES_LIST
let resp = community.enable_two_factor.await?;
// Output detailed setup instructions and secrets
println!;
// Finalize with SMS code (automatic shared_secret handling)
community.finalize_authenticator.await?;
// Or manually with shared_secret (backwards compatible)
community.finalize_two_factor.await?;
// Remove/Disable 2FA
community.remove_authenticator.await?;
// Deauthorize other devices
community.deauthorize_devices.await?;
// Check Steam Guard status
let status = community.get_steam_guard_status.await?;
println!;
// Enable Email Steam Guard
community.enable_steam_guard_email.await?;
// Disable Steam Guard (to None)
community.disable_steam_guard_email.await?;
Profile Management
use ;
// Upload avatar from file
community.upload_avatar_from_file.await?;
// Upload avatar from URL
community.upload_avatar_from_url.await?;
// Edit profile (Name, Real Name, Summary, etc.)
// Note: This preserves existing settings for fields not provided
community.edit_profile.await?;
// Get current privacy settings
let settings = community.get_privacy_settings.await?;
// Update privacy settings
// This preserves existing settings for fields not provided
community.set_privacy_settings.await?;
// Set all privacy settings to Public
community.set_all_privacy.await?;
// Get public profile information
// Use None to fetch the currently logged-in user's profile
let profile = community.get_profile.await?;
println!;
println!;
// Set a nickname for another user
community.set_nickname.await?;
// Remove a nickname
community.remove_nickname.await?;
// Remove a friend
community.remove_friend.await?;
// Accept a pending friend request
community.accept_friend_request.await?;
// Ignore a pending friend request
community.ignore_friend_request.await?;
// Get simple friend list (SteamID map with relationship status)
let friend_map = community.get_friends_list.await?;
// Get detailed friend list (scraped)
let friends = community.get_friends_details.await?;
for friend in friends
// Block a user
community.block_user.await?;
// Unblock a user
community.unblock_user.await?;
// Follow a user
community.follow_user.await?;
// Unfollow a user
community.unfollow_user.await?;
// Invite a user to a group
community.invite_user_to_group.await?;
// Invite multiple users to a group
community.invite_users_to_group.await?;
// Accept a group invitation
community.accept_group_invite.await?;
// Ignore/decline a group invitation
community.ignore_group_invite.await?;
// Search for users by name
let results = community.search_users.await?;
for player in results.players
// Create an instant invite link
let invite_link = community.create_instant_invite.await?;
println!;
// Get current active invite tokens
let tokens = community.get_current_quick_invite_tokens.await?;
for token in tokens.tokens
// --- Profile Comments ---
// Post a comment
if let Some = community.post_comment.await?
// Get comments from a profile
let comments = community.get_user_comments.await?;
for comment in comments
// Delete a comment
community.delete_comment.await?;
Phone Number Management
// Get current phone status
let status = community.get_phone_number_status.await?;
println!; // "none" or "Ends in 17"
// Add a phone number
let resp = community.add_phone_number.await?;
// Confirm with SMS code
community.confirm_phone_number_code.await?;
// Check removal options
let removal = community.get_remove_phone_number_type.await?;
// --- Parental Control ---
// Unlock Family View
community.parental_unlock.await?;
// --- Account Details & Wallet ---
// Get detailed account information
let details = community.get_account_details.await?;
println!;
println!;
println!;
// Get precise wallet balance and currency
let wallet = community.get_steam_wallet_balance.await?;
println!;
println!;
// Get total amount spent on Steam
let amount_spent = community.get_amount_spent_on_steam.await?;
println!;
Market Operations
// Get gem value for an item
let gem_value = community.get_gem_value.await?;
// Get current active listings
let = community.get_my_listings.await?;
// Get market history
let history = community.get_market_history.await?;
// Sell an item
let result = community.sell_item.await?;
// Remove a listing
community.remove_listing.await?;
// Check for market restrictions
let restrictions = community.get_market_restrictions.await?;
if !restrictions.success
Inventory Management
use SteamID;
// Get the logged-in user's inventory
let inventory = community.get_inventory.await?;
// Get another user's inventory
let steam_id = from;
let inventory = community.get_user_inventory_contents.await?;
// Get trading inventory (JSON format)
let trading_inv = community.get_inventory_trading.await?;
// Get a trading partner's inventory
let partner_inv = community.get_inventory_trading_partner.await?;
// Get inventory history
let history = community.get_inventory_history.await?;
for row in history.trade_history
// Get full inventory history (all pages)
let full_history = community.get_full_inventory_history.await?;
// Get market price overview for an item
let price = community.get_price_overview.await?;
if price.success
Trade Management
// Get your own trade URL
if let Some = community.get_trade_url.await?
// Parse a partner's trade URL
if let Some = community.parse_trade_url
// List trade offers
let offers = community.get_trade_offer.await?;
for offer in offers.trade_offers
// Send a trade offer
community.send_trade_offer.await?;
// Accept trade offer
community.accept_trade_offer.await?;
// Decline trade offer
community.decline_trade_offer.await?;
Token Management
// Get all refresh tokens
let tokens = community.get_tokens.await?;
// Check if a specific token ID exists
let exists = community.check_token_exists.await?;
println!;
// Revoke a specific refresh token
community.revoke_token.await?;
// Renew access token using refresh token
community.renew_access_token.await?;
// Get auth session info from QR URL
let info = community.get_auth_session_info.await?;
println!;
// --- License & Loyalty Rewards ---
// Add a free license for a package ID
let success = community.add_free_license.await?;
// Add a free sub license
let success = community.add_sub_free_license.await?;
// Redeem Steam Points for a reward
let result = community.redeem_points.await?;
if let Some = result.communityitemid
Steam App Management
// Get a list of owned apps
let owned_apps = community.get_owned_apps.await?;
for app in owned_apps
// Get detailed information for specific app IDs
let details = community.get_app_detail.await?;
if let Some = details.get
// Fetch CS:GO specific account stats (Rank, XP, etc.)
let stats = community.fetch_csgo_account_stats.await?;
println!;
println!;
// Fetch batched loyalty reward items (Steam Points Shop)
let rewards = community.fetch_batched_loyalty_reward_items.await?;
for batch in rewards
Match History (CS:GO/CS2)
use FullMatchHistoryOptions;
// Get a single page of competitive match history
let history = community.get_match_history.await?;
for m in history.matches
// Fetch next page using continue_token
if !history.continue_token.is_empty
// Get full match history (all pages) with pagination limit
let options = FullMatchHistoryOptions ;
let all_history = community.get_full_history_matches.await?;
for in all_history
Help Requests (Steam Support)
// List all active and past help requests
let requests = community.get_help_requests.await?;
for request in requests
Player Reports
// Get history of players you have reported
let reports = community.get_player_reports.await?;
for report in reports
File Uploads
use CommitFileUploadParams;
// Begin file upload
let result = community.begin_file_upload.await?;
println!;
// Upload the file content to the allocated server
community.do_file_upload.await?;
// Commit the upload to finalize it
let commit_resp = community.commit_file_upload.await?;
if let Some = commit_resp.result.and_then
Remote Client (feature remote)
RemoteSteamUser mirrors the SteamUser API but delegates all operations to a remote steam-user-api REST server via HTTP. Supports round-robin load balancing and automatic retry.
Quick Start
use RemoteSteamUser;
async
Round-Robin Load Balancing
use RemoteSteamUser;
let user = with_urls;
// Requests rotate across the 3 servers automatically
// If a server fails, the next one is tried (up to 5 retries by default)
Configuration
use RemoteSteamUser;
let mut user = new;
// Set max retry attempts (default: 5)
user.set_max_retries;
// Set optional tokens
user.set_access_token;
user.set_refresh_token;
user.set_mobile_access_token;
user.set_identity_secret;
user.set_shared_secret;
Local vs Remote
// Local — direct Steam web requests
let user = new?;
let balance = user.get_steam_wallet_balance.await?;
// Remote — delegates to steam-user-api server
use RemoteSteamUser;
let user = new;
let balance = user.get_steam_wallet_balance.await?;
Note:
SteamUserreturns typed Rust structs, whileRemoteSteamUserreturnsserde_json::Value. Both implement theSteamUserApitrait.
SteamUserApi Trait
Both SteamUser and RemoteSteamUser implement the SteamUserApi trait, providing a unified interface:
use SteamUserApi;
async
Services
| Module | Description |
|---|---|
services::confirmations |
Mobile trade/market confirmations |
services::twofactor |
Steam Guard 2FA management |
services::profile |
Profile and privacy settings |
services::market |
Steam Market operations |
services::inventory |
Inventory access |
services::groups |
Steam group interactions |
services::friends |
User friend requests and invites |
services::comments |
Profile comment management |
services::trade |
Steam trade offer operations |
services::account |
Phone number and account management |
services::tokens |
Refresh token management |
services::license |
License and loyalty rewards management |
services::apps |
Steam application and CS:GO account services |
services::match_history |
CS:GO/CS2 match history retrieval |
services::file_upload |
File upload workflow (begin, do, commit) |
services::help |
Steam Support help request management |
services::reports |
Player report history retrieval |
remote::* |
Remote HTTP client (feature remote) |
Types
| Type | Description |
|---|---|
SteamUser |
Main client for Steam Community interactions |
Session |
Authentication session with cookies |
Confirmation |
Mobile confirmation data |
ConfirmationType |
Trade, market listing, etc. |
PrivacySettings |
Profile privacy configuration |
MarketItem |
Market listing information |
EconItem |
Economy/inventory item |
AddPhoneNumberResponse |
Result of adding a phone number |
RemovePhoneResult |
Available phone removal methods |
TradeOffer |
Detailed trade offer data |
TradeOffersResponse |
List of active trade offers |
SteamEnumerateTokensResponse |
List of active refresh tokens |
OwnedApp |
Basic owned application data |
AppDetail |
Comprehensive Steam Store app information |
CsgoAccountStats |
Personal CS:GO rank and activity data |
MatchHistoryResponse |
Paginated match history with continue token |
Match |
Single CS:GO/CS2 match with player data and scoreboard |
MatchInfo |
Match metadata (map, time, duration, GOTV replay) |
MatchPlayer |
Player stats in a match (K/D/A, MVP, HSP) |
HelpRequest |
Steam Support ticket summary (ID, title, status) |
PlayerReport |
Details of a reported player (ID, reason, timestamp) |
License
This project is licensed under the MIT License.