Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/d-e-s-o/apca
A crate for interacting with the Alpaca API at alpaca.markets.
https://github.com/d-e-s-o/apca
alpaca alpaca-api alpaca-markets alpaca-trading-api rust rust-crate rust-library
Last synced: 3 days ago
JSON representation
A crate for interacting with the Alpaca API at alpaca.markets.
- Host: GitHub
- URL: https://github.com/d-e-s-o/apca
- Owner: d-e-s-o
- License: gpl-3.0
- Created: 2020-04-21T04:09:01.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-14T16:29:09.000Z (10 months ago)
- Last Synced: 2024-05-01T13:58:33.863Z (9 months ago)
- Topics: alpaca, alpaca-api, alpaca-markets, alpaca-trading-api, rust, rust-crate, rust-library
- Language: Rust
- Homepage:
- Size: 1.87 MB
- Stars: 122
- Watchers: 5
- Forks: 35
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust - d-e-s-o/apca - e-s-o/apca/actions/workflows/test.yml/badge.svg?branch=main) (Libraries / Finance)
- fucking-awesome-rust - d-e-s-o/apca - Opinionated and comprehensive bindings to the 🌎 [Alpaca API](alpaca.markets/) for stock trading and more. ![GitHub Workflow Status](https://github.com/d-e-s-o/apca/actions/workflows/test.yml/badge.svg?branch=main) (Libraries / Finance)
- awesome-rust - d-e-s-o/apca - Opinionated and comprehensive bindings to the [Alpaca API](https://alpaca.markets/) for stock trading and more. ![GitHub Workflow Status](https://github.com/d-e-s-o/apca/actions/workflows/test.yml/badge.svg?branch=main) (Libraries / Finance)
- fucking-awesome-rust - d-e-s-o/apca - Opinionated and comprehensive bindings to the 🌎 [Alpaca API](alpaca.markets/) for stock trading and more. ![GitHub Workflow Status](https://github.com/d-e-s-o/apca/actions/workflows/test.yml/badge.svg?branch=main) (Libraries / Finance)
README
[![pipeline](https://github.com/d-e-s-o/apca/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/d-e-s-o/apca/actions/workflows/test.yml)
[![coverage](https://codecov.io/gh/d-e-s-o/apca/branch/main/graph/badge.svg)](https://codecov.io/gh/d-e-s-o/apca)
[![crates.io](https://img.shields.io/crates/v/apca.svg)](https://crates.io/crates/apca)
[![Docs](https://docs.rs/apca/badge.svg)](https://docs.rs/apca)
[![rustc](https://img.shields.io/badge/rustc-1.63+-blue.svg)](https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html)apca
====- [Documentation][docs-rs]
- [Changelog](CHANGELOG.md)**apca** is a library for interacting with the Alpaca API at
[alpaca.markets][]. The crate is entirely written in Rust and exposes a
fully async API based on the native `async`/`await` language feature.The crate provides access to the majority of functionality provided by
Alpaca, including, but not limited to:
- inquiring of account information
- changing of the account configuration
- retrieving of past account activity
- accessing the market clock
- submitting, changing, listing, and canceling orders
- listing and closing open positions
- listing and retrieving general asset information
- streaming of order updates over WebSocket
- historic market data retrieval through Alpaca's Data API
- real time market data streaming via Alpaca's websocket APIFor convenient command-line based access to the API, please use
[`apcacli`][apcacli].Usage
-----The following example illustrates how to create a `Client` object and
then submit a limit order for `AAPL` with a limit price of USD 100:
```rust
let api_info = ApiInfo::from_env().unwrap();
let client = Client::new(api_info);let request = order::CreateReqInit {
type_: Type::Limit,
limit_price: Some(Num::from(100)),
..Default::default()
}
.init("AAPL", Side::Buy, order::Amount::quantity(1));let order = client
.issue::(&request)
.await
.unwrap();
```The returned `order` object can subsequently be inspected to find out
details about the order (such as its ID). The full example is available
[here][example-order].Please refer to the full [documentation][docs-rs] for more details.
[example-order]: examples/order.rs
[docs-rs]: https://docs.rs/crate/apca
[alpaca.markets]: https://alpaca.markets
[apcacli]: https://crates.io/crates/apcacli
[polyio]: https://crates.io/crates/polyio