BW Web API (Rust)
A Rust client library for interacting with the StarCraft: Remastered API.
Features
- Strongly typed API client
- Complete coverage of available endpoints
- Async/await support
- Comprehensive error handling
Installation
[]
= "0.2"
Or via cargo:
Usage
This library uses async/await and requires an async runtime such as tokio.
use ;
async
Available Endpoints
get_aurora_profile_by_toon_scr_profile(toon, gateway)(and other field-mask variants) - Get player profile informationget_global_maps_1v1()- Get available 1v1 mapsget_gateway_status()- Get status of all gatewaysget_leaderboard()- Get leaderboard metadata including available gamemodes, gateways, and leaderboardsget_leaderboard_entity(leaderboard_id)- Get leaderboard entries for a specific leaderboardget_leaderboard_rank(leaderboard_id, toon, gateway)- Get specific player's rankingsearch_leaderboard_by_battletag(leaderboard_id, battletag)- Search a leaderboard for players matching a Battletagget_map_stats(toon, gateway)- Get player's map statisticsget_matchmaker_gameinfo(toon, gateway, gamemode, season, offset, limit)- Get player's match historyget_matchmaker_player_info(match_id)- Get detailed match information
Field Masks for Aurora Profile
ScrProfile- Basic profile informationScrMmGameLoading- Matchmaking game loading informationScrMmToonInfo- Detailed matchmaking informationScrToonInfo- Basic character information
StarCraft Port Detection
To find the port StarCraft: Remastered is using on Windows (requires administrator privileges):
(Get-NetTCPConnection -OwningProcess (Get-Process -Name StarCraft | Select-Object -ExpandProperty Id) | Where-Object {$_.State -eq "Listen"} | Sort-Object -Property LocalPort | Select-Object -First 1).LocalPort
Error Handling
The library provides a comprehensive error type ApiError that covers:
- Network errors
- API errors
- Deserialization errors
- Invalid parameters
License
This project is licensed under the MIT License - see the LICENSE file for details.