Do Not Use This Package In Any Serious Capcity. Not Liable for Any Issues.
Alpaca is a trading platform for developers and app makers, and they provide various endpoints to access over http. The goal of this package is to provide the bare minimum tools for using the Alpaca API, and to learn more about open source software building. This is not a batteries included package yet, and still requires a lot of testing.
To install the Alpaca API Client, you will need Rust installed on your machine. If you don't have Rust installed, you can follow the official guide.
Once Rust is installed, you can install the Alpaca API Client using cargo:
bash
cargo install alpaca_api_client
Add your API keys to an .env file in the root of your directory with these names.
```bash // /.env
APCAAPIKEYID=
Get bars for a single stock
```rust use alpacaapiclient::get_bars;
let bars = get_bars("BTU", "1Day", Some("start=2023-02-23")); ```
Get bars for multiple symbols
```rust use alpacaapiclient::getmultibars;
let watchlist: [&str; 30] = [ "META", "DIS", "CMCSA", "VZ", "T", "CHTR", "NFLX", "TMUS", "TWTR", "FOXA", "FOX", "DISH", "CBS", "OMC", "TME", "TTWO", "EA", "ATVI", "ZM", "MTCH", "IAC", "NTES", "BIDU", "ROKU", "SPOT", "LYV", "IQ", "HUYA", "DOYU", "VIAV", ];
let multibars: MultiBars = getmulti_bars(&watchlist, "1Day", Some("start=2022-01-01")); ```
Place market order
```rust use alpacaapiclient::{placemarketorder, OrderSide};
let order = placemarketorder("SO", 3.0, OrderSide::Buy); ```
Any and all PR's are welcome. This is my first Rust project and my first foray into open source. I see a need for this type of Rust client to support Alpaca's v2 API.
This project is licensed under the MIT and APACHE License.