Crypto
- Module path:
alpaca_data::crypto - Client type:
CryptoClient - docs.rs module: https://docs.rs/alpaca-data/latest/alpaca_data/crypto/
- Site rustdoc module: https://wmzhai.github.io/alpaca-data-rs/api/alpaca_data/crypto/
- Scope: Public API surface
Crypto market data endpoints. Mirror methods cover historical bars, quotes, trades, latest data, latest orderbooks, and snapshots. Convenience methods add:
Methods
| Method | Kind | Async | Request | Return | docs.rs | Site rustdoc |
|---|---|---|---|---|---|---|
bars | mirror | yes | BarsRequest | Result<BarsResponse, Error> | docs.rs | site |
bars_all | convenience | yes | BarsRequest | Result<BarsResponse, Error> | docs.rs | site |
bars_stream | convenience | no | BarsRequest | ResponseStream<Result<BarsResponse, Error>> | docs.rs | site |
quotes | mirror | yes | QuotesRequest | Result<QuotesResponse, Error> | docs.rs | site |
quotes_all | convenience | yes | QuotesRequest | Result<QuotesResponse, Error> | docs.rs | site |
quotes_stream | convenience | no | QuotesRequest | ResponseStream<Result<QuotesResponse, Error>> | docs.rs | site |
trades | mirror | yes | TradesRequest | Result<TradesResponse, Error> | docs.rs | site |
trades_all | convenience | yes | TradesRequest | Result<TradesResponse, Error> | docs.rs | site |
trades_stream | convenience | no | TradesRequest | ResponseStream<Result<TradesResponse, Error>> | docs.rs | site |
latest_bars | mirror | yes | LatestBarsRequest | Result<LatestBarsResponse, Error> | docs.rs | site |
latest_quotes | mirror | yes | LatestQuotesRequest | Result<LatestQuotesResponse, Error> | docs.rs | site |
latest_trades | mirror | yes | LatestTradesRequest | Result<LatestTradesResponse, Error> | docs.rs | site |
latest_orderbooks | mirror | yes | LatestOrderbooksRequest | Result<LatestOrderbooksResponse, Error> | docs.rs | site |
snapshots | mirror | yes | SnapshotsRequest | Result<SnapshotsResponse, Error> | docs.rs | site |
Requests
BarsRequest
- Kind: struct
- Summary: -
- docs.rs: BarsRequest
- Site rustdoc: BarsRequest
| Field | Official Word | Type | Notes |
|---|---|---|---|
symbols | symbols | Vec<String> | - |
timeframe | timeframe | TimeFrame | - |
start | start | Option<String> | - |
end | end | Option<String> | - |
limit | limit | Option<u32> | - |
sort | sort | Option<Sort> | - |
loc | loc | Option<Loc> | - |
page_token | page_token | Option<String> | - |
LatestBarsRequest
- Kind: struct
- Summary: -
- docs.rs: LatestBarsRequest
- Site rustdoc: LatestBarsRequest
| Field | Official Word | Type | Notes |
|---|---|---|---|
symbols | symbols | Vec<String> | - |
loc | loc | Option<Loc> | - |
LatestOrderbooksRequest
- Kind: struct
- Summary: -
- docs.rs: LatestOrderbooksRequest
- Site rustdoc: LatestOrderbooksRequest
| Field | Official Word | Type | Notes |
|---|---|---|---|
symbols | symbols | Vec<String> | - |
loc | loc | Option<Loc> | - |
LatestQuotesRequest
- Kind: struct
- Summary: -
- docs.rs: LatestQuotesRequest
- Site rustdoc: LatestQuotesRequest
| Field | Official Word | Type | Notes |
|---|---|---|---|
symbols | symbols | Vec<String> | - |
loc | loc | Option<Loc> | - |
LatestTradesRequest
- Kind: struct
- Summary: -
- docs.rs: LatestTradesRequest
- Site rustdoc: LatestTradesRequest
| Field | Official Word | Type | Notes |
|---|---|---|---|
symbols | symbols | Vec<String> | - |
loc | loc | Option<Loc> | - |
QuotesRequest
- Kind: struct
- Summary: -
- docs.rs: QuotesRequest
- Site rustdoc: QuotesRequest
| Field | Official Word | Type | Notes |
|---|---|---|---|
symbols | symbols | Vec<String> | - |
start | start | Option<String> | - |
end | end | Option<String> | - |
limit | limit | Option<u32> | - |
sort | sort | Option<Sort> | - |
loc | loc | Option<Loc> | - |
page_token | page_token | Option<String> | - |
SnapshotsRequest
- Kind: struct
- Summary: -
- docs.rs: SnapshotsRequest
- Site rustdoc: SnapshotsRequest
| Field | Official Word | Type | Notes |
|---|---|---|---|
symbols | symbols | Vec<String> | - |
loc | loc | Option<Loc> | - |
TradesRequest
- Kind: struct
- Summary: -
- docs.rs: TradesRequest
- Site rustdoc: TradesRequest
| Field | Official Word | Type | Notes |
|---|---|---|---|
symbols | symbols | Vec<String> | - |
start | start | Option<String> | - |
end | end | Option<String> | - |
limit | limit | Option<u32> | - |
sort | sort | Option<Sort> | - |
loc | loc | Option<Loc> | - |
page_token | page_token | Option<String> | - |
Responses
BarsResponse
- Kind: struct
- Summary: -
- docs.rs: BarsResponse
- Site rustdoc: BarsResponse
| Field | Official Word | Type | Notes |
|---|---|---|---|
bars | bars | HashMap<String, Vec<Bar>> | - |
next_page_token | next_page_token | Option<String> | - |
LatestBarsResponse
- Kind: struct
- Summary: -
- docs.rs: LatestBarsResponse
- Site rustdoc: LatestBarsResponse
| Field | Official Word | Type | Notes |
|---|---|---|---|
bars | bars | HashMap<String, Bar> | - |
LatestOrderbooksResponse
- Kind: struct
- Summary: -
- docs.rs: LatestOrderbooksResponse
- Site rustdoc: LatestOrderbooksResponse
| Field | Official Word | Type | Notes |
|---|---|---|---|
orderbooks | orderbooks | HashMap<String, Orderbook> | - |
LatestQuotesResponse
- Kind: struct
- Summary: -
- docs.rs: LatestQuotesResponse
- Site rustdoc: LatestQuotesResponse
| Field | Official Word | Type | Notes |
|---|---|---|---|
quotes | quotes | HashMap<String, Quote> | - |
LatestTradesResponse
- Kind: struct
- Summary: -
- docs.rs: LatestTradesResponse
- Site rustdoc: LatestTradesResponse
| Field | Official Word | Type | Notes |
|---|---|---|---|
trades | trades | HashMap<String, Trade> | - |
QuotesResponse
- Kind: struct
- Summary: -
- docs.rs: QuotesResponse
- Site rustdoc: QuotesResponse
| Field | Official Word | Type | Notes |
|---|---|---|---|
quotes | quotes | HashMap<String, Vec<Quote>> | - |
next_page_token | next_page_token | Option<String> | - |
SnapshotsResponse
- Kind: struct
- Summary: -
- docs.rs: SnapshotsResponse
- Site rustdoc: SnapshotsResponse
| Field | Official Word | Type | Notes |
|---|---|---|---|
snapshots | snapshots | HashMap<String, Snapshot> | - |
TradesResponse
- Kind: struct
- Summary: -
- docs.rs: TradesResponse
- Site rustdoc: TradesResponse
| Field | Official Word | Type | Notes |
|---|---|---|---|
trades | trades | HashMap<String, Vec<Trade>> | - |
next_page_token | next_page_token | Option<String> | - |
Models
Bar
| Field | Official Word | Type | Notes |
|---|---|---|---|
t | t | Option<Timestamp> | - |
o | o | Option<f64> | - |
h | h | Option<f64> | - |
l | l | Option<f64> | - |
c | c | Option<f64> | - |
v | v | Option<f64> | - |
n | n | Option<u64> | - |
vw | vw | Option<f64> | - |
Orderbook
| Field | Official Word | Type | Notes |
|---|---|---|---|
t | t | Option<Timestamp> | - |
b | b | Option<Vec<OrderbookLevel>> | - |
a | a | Option<Vec<OrderbookLevel>> | - |
OrderbookLevel
- Kind: struct
- Summary: -
- docs.rs: OrderbookLevel
- Site rustdoc: OrderbookLevel
| Field | Official Word | Type | Notes |
|---|---|---|---|
p | p | Option<f64> | - |
s | s | Option<f64> | - |
Quote
| Field | Official Word | Type | Notes |
|---|---|---|---|
t | t | Option<Timestamp> | - |
bp | bp | Option<f64> | - |
bs | bs | Option<f64> | - |
ap | ap | Option<f64> | - |
r#as | as | Option<f64> | - |
Snapshot
| Field | Official Word | Type | Notes |
|---|---|---|---|
latestTrade | latestTrade | Option<Trade> | - |
latestQuote | latestQuote | Option<Quote> | - |
minuteBar | minuteBar | Option<Bar> | - |
dailyBar | dailyBar | Option<Bar> | - |
prevDailyBar | prevDailyBar | Option<Bar> | - |
Trade
| Field | Official Word | Type | Notes |
|---|---|---|---|
t | t | Option<Timestamp> | - |
p | p | Option<f64> | - |
s | s | Option<f64> | - |
i | i | Option<u64> | - |
tks | tks | Option<String> | - |
Enums
Loc
| Variant | Official Value |
|---|---|
Us | us |
Us1 | us-1 |
Us2 | us-2 |
Eu1 | eu-1 |
Bs1 | bs-1 |
TimeFrame
- Kind: struct
- Summary: -
- docs.rs: TimeFrame
- Site rustdoc: TimeFrame
- Example constructors:
min_1 -> 1Min,day_1 -> 1Day
Related Repository Artifacts
- Examples:
examples/crypto_latest_quotes.rs - Tests:
tests/live_crypto_historical.rs,tests/live_crypto_latest.rs,tests/live_crypto_latest_quotes_smoke.rs,tests/live_crypto_loc_variants.rs,tests/live_crypto_snapshots.rs,tests/mock_crypto_errors.rs - Benchmarks:
benches/crypto.rs
Coverage Notes
- The strict endpoint parity ledger for this module lives in API Coverage.
- Generated reference pages mirror the shipped Rust surface and do not claim unimplemented Alpaca endpoints as available.