steamr 🦀

crates.io Documentation Apache-2 licensed CI

steamr is a simple Rust library to help you to interact with Valve's Steam API. It uses the reqwest crate under the hood.

Requirements

You need a valid API key to use this library. Visit https://steamcommunity.com/dev/apikey to obtain yours.

Example

```rust,norun use steamr::SteamClient; use steamr::errors::SteamError; use steamr::games::getowned_games;

fn main() -> Result<(), SteamError> { // Create a new client that will be used to communicate with Steam's API. let apikey = String::from("your-api-key"); let steamclient = SteamClient::new(api_key);

// Get a list of all games from the user with the provided Steam ID (given that they are publicly visible)
let steam_id = String::from("some-steam-id");
let steam_lib = get_owned_games(&steam_client, &steam_id)?;

// Print out the games that were played for more than an hour.
steam_lib.games.iter()
    .filter(|g| g.playtime_forever > 60)
    .for_each(|g| println!("{}", g.name));

Ok(())

} ```

💡 You can find more examples on the crate's doc.rs pages.