Crates.io | steam-api |
lib.rs | steam-api |
version | 0.4.1 |
source | src |
created_at | 2021-07-27 03:11:47.514189 |
updated_at | 2021-08-04 23:15:25.83888 |
description | A crate for interacting with the steam api |
homepage | |
repository | https://github.com/dindybutts/steam-api |
max_upload_size | |
id | 427759 |
size | 55,506 |
Simple crate to interact with the Steam API
# Running the example
API_KEY=XXXXXXXXXXXXXXXXXXX cargo run --example example_program
# Running the tests
API_KEY=XXXXXXXXXXXXXXXXXXX cargo test
fn main() -> anyhow::Result<()> {
let steamids = vec![
"76561198421169032",
"76561198149368420",
];
for user in steam_api::get_profile_info(&steamids, &std::env::var("API_KEY")?)?.user {
match user.steamid.as_str() {
"76561198421169032" => {
println!("Persona Name\t{}", user.personaname);
println!("Steam Level\t{}", user.player_level);
println!("NumberOfVACBans\t{}", user.NumberOfVACBans);
assert_eq!(user.personaname, "dind");
}
"76561198149368420" => {
println!("Persona Name\t{}", user.personaname);
println!("Steam Level\t{}", user.player_level);
println!("NumberOfVACBans\t{}", user.NumberOfVACBans);
assert_eq!(user.personaname, "Gone compilin'");
assert!(user.VACBanned);
}
_ => (),
}
}
Ok(())
}
Get your API Key here