10 个版本 (4 个破坏性版本)
0.4.4 | 2024年2月17日 |
---|---|
0.4.3 | 2024年2月17日 |
0.4.0 | 2023年12月12日 |
0.3.1 | 2023年8月6日 |
0.0.0 | 2023年7月26日 |
#518 in Web 编程
每月下载量 102
110KB
2.5K SLoC
steam-rs
此 crate 为 Steam Web API 提供安全且方便的 Rust 绑定。
在开发此 crate 时使用了以下资源
- 更好的 Steam Web API 文档
- Steam Web API - Valve 开发者社区
- Steamworks Web API 参考
- WebAPI - 官方 TF2 Wiki
- xpaw 的 Steam Web API 文档
这不是生产就绪的!
此 crate 高度实验性和未完成,因此建议您在使用它时谨慎行事。
支持的 API 端点
有关所有支持的 API 接口和端点的列表,请参阅 ENDPOINTS.md。
使用方法
use std::env;
use steam_rs::{Steam, SteamId};
#[tokio::main]
async fn main() {
// Get the Steam API Key as an environment variable
let steam_api_key = env::var("STEAM_API_KEY").expect("Missing an API key");
// Initialize the Steam API client
let steam = Steam::new(steam_api_key);
// Request the recently played games of SteamID `76561197960434622`
let steam_id = SteamId::new(76561197960434622);
let recently_played_games = steam.get_recently_played_games(steam_id, None).await.unwrap();
// Print the total count of the user's recently played games
println!("{}", recently_played_games.total_count);
}
贡献
此项目处于开发早期阶段,因此欢迎提交错误报告、建议和拉取请求!
许可证
此项目根据 MIT 许可证 许可。
依赖项
~4–12MB
~121K SLoC