Interface IAlpacaCryptoDataClient
Provides unified type-safe access for Alpaca Crypto Data API via HTTP/REST.
Inherited Members
Namespace: Alpaca.Markets
Assembly: Alpaca.Markets.dll
Syntax
public interface IAlpacaCryptoDataClient : IHistoricalQuotesClient<HistoricalCryptoQuotesRequest>, IHistoricalTradesClient<HistoricalCryptoTradesRequest>, IHistoricalBarsClient<HistoricalCryptoBarsRequest>, IAlpacaScreenerClient, IRateLimitProvider
Methods
| Improve this Doc View SourceGetLatestBarAsync(LatestDataRequest, CancellationToken)
Gets most recent bar for a single asset from Alpaca REST API endpoint.
Declaration
Task<IBar> GetLatestBarAsync(LatestDataRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestDataRequest | request | Asset symbol and exchange pair for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IBar> | Read-only latest bar information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
GetLatestBestBidOfferAsync(LatestBestBidOfferRequest, CancellationToken)
Gets current cross-exchange best bid/offer (XBBO) for single asset from Alpaca REST API endpoint.
Declaration
Task<IQuote> GetLatestBestBidOfferAsync(LatestBestBidOfferRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestBestBidOfferRequest | request | Asset symbol and exchanges list pair for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IQuote> | Read-only current XBBO information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
GetLatestQuoteAsync(LatestDataRequest, CancellationToken)
Gets current quote for single asset from Alpaca REST API endpoint.
Declaration
Task<IQuote> GetLatestQuoteAsync(LatestDataRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestDataRequest | request | Asset symbol and exchange pair for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IQuote> | Read-only current quote information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
GetLatestTradeAsync(LatestDataRequest, CancellationToken)
Gets most recent trade for a single asset from Alpaca REST API endpoint.
Declaration
Task<ITrade> GetLatestTradeAsync(LatestDataRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestDataRequest | request | Asset symbol and exchange pair for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<ITrade> | Read-only latest trade information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
GetSnapshotAsync(SnapshotDataRequest, CancellationToken)
Gets current snapshot data for single asset from Alpaca REST API endpoint.
Declaration
Task<ISnapshot> GetSnapshotAsync(SnapshotDataRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
SnapshotDataRequest | request | Asset symbol and exchange pair for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<ISnapshot> | Read-only current snapshot information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
ListLatestBarsAsync(LatestDataListRequest, CancellationToken)
Gets most recent bar for several assets from Alpaca REST API endpoint.
Declaration
Task<IReadOnlyDictionary<String, IBar>> ListLatestBarsAsync(LatestDataListRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestDataListRequest | request | Asset symbols list for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IReadOnlyDictionary<String, IBar>> | Read-only dictionary with the latest bars information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
ListLatestBestBidOffersAsync(LatestBestBidOfferListRequest, CancellationToken)
Gets current cross-exchange best bid/offer (XBBO) for several assets from Alpaca REST API endpoint.
Declaration
Task<IReadOnlyDictionary<String, IQuote>> ListLatestBestBidOffersAsync(LatestBestBidOfferListRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestBestBidOfferListRequest | request | Asset symbol and exchanges list pair for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IReadOnlyDictionary<String, IQuote>> | Read-only dictionary with the current XBBO information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
ListLatestOrderBooksAsync(LatestOrderBooksRequest, CancellationToken)
Gets current order books for several assets from Alpaca REST API endpoint.
Declaration
Task<IReadOnlyDictionary<String, IOrderBook>> ListLatestOrderBooksAsync(LatestOrderBooksRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestOrderBooksRequest | request | Asset symbols list for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IReadOnlyDictionary<String, IOrderBook>> | Read-only dictionary with the current order book information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
ListLatestQuotesAsync(LatestDataListRequest, CancellationToken)
Gets most recent quote for several assets from Alpaca REST API endpoint.
Declaration
Task<IReadOnlyDictionary<String, IQuote>> ListLatestQuotesAsync(LatestDataListRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestDataListRequest | request | Asset symbols list for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IReadOnlyDictionary<String, IQuote>> | Read-only dictionary with the latest quotes information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
ListLatestTradesAsync(LatestDataListRequest, CancellationToken)
Gets most recent trade for several assets from Alpaca REST API endpoint.
Declaration
Task<IReadOnlyDictionary<String, ITrade>> ListLatestTradesAsync(LatestDataListRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestDataListRequest | request | Asset symbols list for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IReadOnlyDictionary<String, ITrade>> | Read-only dictionary with the latest trades information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
ListSnapshotsAsync(SnapshotDataListRequest, CancellationToken)
Gets current snapshot data for several assets from Alpaca REST API endpoint.
Declaration
Task<IReadOnlyDictionary<String, ISnapshot>> ListSnapshotsAsync(SnapshotDataListRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
SnapshotDataListRequest | request | Asset symbol for data retrieval. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IReadOnlyDictionary<String, ISnapshot>> | Read-only dictionary with the current snapshot information. |
Exceptions
Type | Condition |
---|---|
RequestValidationException | The |
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |