Interface IAlpacaOptionsDataClient
Provides unified type-safe access for Alpaca Options Data API via HTTP/REST.
Inherited Members
Namespace: Alpaca.Markets
Assembly: Alpaca.Markets.dll
Syntax
public interface IAlpacaOptionsDataClient : IHistoricalTradesClient<HistoricalOptionTradesRequest>, IHistoricalBarsClient<HistoricalOptionBarsRequest>, IRateLimitProvider
Methods
| Improve this Doc View SourceGetOptionChainAsync(OptionChainRequest, CancellationToken)
Gets option chain (snapshots list) for option contracts with same underlying symbol from Alpaca REST API endpoint.
Declaration
Task<IDictionaryPage<IOptionSnapshot>> GetOptionChainAsync(OptionChainRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
OptionChainRequest | request | Option contracts latest data request. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IDictionaryPage<IOptionSnapshot>> | 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. |
ListExchangesAsync(CancellationToken)
Gets dictionary with exchange code to the exchange name mappings.
Declaration
Task<IReadOnlyDictionary<String, String>> ListExchangesAsync(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
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, String>> | Read-only dictionary where the key is the exchange code and the value is the code's corresponding exchange name. |
Exceptions
Type | Condition |
---|---|
RestClientErrorException | The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch. |
ListLatestQuotesAsync(LatestOptionsDataRequest, CancellationToken)
Gets most recent quotes for several option contracts from Alpaca REST API endpoint.
Declaration
Task<IReadOnlyDictionary<String, IQuote>> ListLatestQuotesAsync(LatestOptionsDataRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestOptionsDataRequest | request | Option contracts latest data request. |
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(LatestOptionsDataRequest, CancellationToken)
Gets most recent trades for several option contracts from Alpaca REST API endpoint.
Declaration
Task<IReadOnlyDictionary<String, ITrade>> ListLatestTradesAsync(LatestOptionsDataRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
LatestOptionsDataRequest | request | Option contracts latest data request. |
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(OptionSnapshotRequest, CancellationToken)
Gets current snapshot (latest trade/quote) for several option contracts from Alpaca REST API endpoint.
Declaration
Task<IDictionaryPage<IOptionSnapshot>> ListSnapshotsAsync(OptionSnapshotRequest request, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
OptionSnapshotRequest | request | Option contracts latest data request. |
CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
Task<IDictionaryPage<IOptionSnapshot>> | 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. |