# BW Web API (rust edition)
A Rust library for interacting with the StarCraft Brood War API.
This is a port of the [bw-web-api](https://github.com/evanandrewrose/bw-web-api) library, which is written in TypeScript. You can find more information there such as endpoint documentation, the expected shape of responses, etc.
Not every endpoint is working yet and this is still a work in progress. However, the most useful endpoints are implemented and working (eg. `aurora_profile_by_toon`).
# Installation
`cargo add bw-web-api-rs`
# Usage
```rust
use bw_api::{AuroraProfileByToonV2FieldMask, BWClient, Region, SCApi};
#[tokio::main]
async fn main() {
let client = BWClient::new("http://localhost/:12345").unwrap();
let api = SCApi::new(client).unwrap();
let response = api
.aurora_profile_by_toon(
"By.SnOw1",
Region::Korea,
AuroraProfileByToonV2FieldMask::ScrProfile,
)
.await;
match response {
Ok(profile) => println!("{:?}", profile),
Err(e) => eprintln!("Error: {}", e),
}
}
```
# StarCraft Port
The port StarCraft opens for the web API will not always be the same. You can determine the port on Windows via:
(as administrator)
```