Show / Hide Table of Contents

Interface IAlpacaOptionsDataClient

Provides unified type-safe access for Alpaca Options Data API via HTTP/REST.

Inherited Members
IHistoricalTradesClient<HistoricalOptionTradesRequest>.ListHistoricalTradesAsync(HistoricalOptionTradesRequest, CancellationToken)
IHistoricalTradesClient<HistoricalOptionTradesRequest>.GetHistoricalTradesAsync(HistoricalOptionTradesRequest, CancellationToken)
IHistoricalBarsClient<HistoricalOptionBarsRequest>.ListHistoricalBarsAsync(HistoricalOptionBarsRequest, CancellationToken)
IHistoricalBarsClient<HistoricalOptionBarsRequest>.GetHistoricalBarsAsync(HistoricalOptionBarsRequest, CancellationToken)
IRateLimitProvider.GetRateLimitValues()
Namespace: Alpaca.Markets
Assembly: Alpaca.Markets.dll
Syntax
public interface IAlpacaOptionsDataClient : IHistoricalTradesClient<HistoricalOptionTradesRequest>, IHistoricalBarsClient<HistoricalOptionBarsRequest>, IRateLimitProvider

Methods

| Improve this Doc View Source

GetOptionChainAsync(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 request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

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 request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

| Improve this Doc View Source

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 request argument contains invalid data or some required data is missing, unable to create a valid HTTP request.

RestClientErrorException

The response contains an error message or the received response cannot be deserialized properly due to JSON schema mismatch.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX