Skip to main content

Crate steam_user

Crate steam_user 

Source
Expand description

Steam Community web client for Rust.

This crate provides HTTP-based interactions with Steam Community web endpoints, including mobile confirmations, profile management, market operations, and more.

§Crate layout

Users only need to depend on steam-user:

[dependencies]
steam-user = "0.1"

The companion crate steam-user-impl holds the #[steam_endpoint] procedural macro and exists only because Rust requires proc-macros to live in a separate crate (the same reason serde/serde_derive, tokio/tokio-macros, and thiserror/thiserror-impl are split). The single macro it exports is re-exported here as endpoint::steam_endpoint under #[doc(hidden)]. Do not depend on steam-user-impl directly — its API is unstable and version-locked (=X.Y.Z) to this crate.

§Overview

This crate interacts with Steam via regular HTTP requests to steamcommunity.com endpoints. This is useful for:

  • Managing mobile trade confirmations
  • Two-factor authentication setup
  • Profile editing
  • Market and inventory operations
  • Group management

§Example

use steam_user::SteamUser;

#[tokio::main]
async fn main() -> Result<(), steam_user::SteamUserError> {
    let mut community = SteamUser::new(&["steamLoginSecure=...", "sessionid=..."])?;

    // Check if logged in
    let logged_in = community.logged_in().await?;
    println!("Logged in: {:?}", logged_in);

    Ok(())
}

Re-exports§

pub use client::SteamUser;
pub use fallback::FallbackSteamUser;
pub use steam_user_api::SteamUserApi;
pub use types::match_history::Match;
pub use types::match_history::MatchHistoryResponse;
pub use types::match_history::MatchHistoryType;
pub use types::match_history::MatchPlayer;
pub use types::match_history::Team;
pub use types::AliasEntry;
pub use types::AppDetail;
pub use types::AppPriceOverview;
pub use types::BanStatus;
pub use types::BoosterPackEntry;
pub use types::CsgoAccountStats;
pub use types::EconItem;
pub use types::FriendDetails;
pub use types::GameBanData;
pub use types::GemValue;
pub use types::GroupInfo;
pub use types::MarketItem;
pub use types::OwnedApp;
pub use types::PrivacySettings;
pub use types::PrivacyState;
pub use types::ProfileSettings;
pub use types::PublicProfileSummary;
pub use types::SteamGuardStatus;
pub use types::SteamProfile;
pub use types::TwoFactorResponse;
pub use types::UserComment;

Modules§

client
Steam Community client.
endpoint
Endpoint metadata for Steam HTTP methods.
fallback
limiter
services
Service modules for various Steam community and store features.
steam_user_api
Shared trait defining the SteamUser API surface.
types
Type definitions for Steam Community operations.
utils
Utility functions for Steam Community.

Structs§

Session
Session manager for Steam Community.
SteamID
Represents a Steam ID with all its components.

Enums§

ApiAction
All available actions exposed by SteamUserApi.
SteamUserError
Errors that can occur during Steam Community operations.

Traits§

ActionContext
Extension trait to attach ApiAction context to errors.