Table of Contents

Interface IAlphaVantageClient

Namespace
Tudormobile.AlphaVantage
Assembly
Tudormobile.AlphaVantageAPI.dll

Defines a contract for accessing financial data and services provided by the Alpha Vantage API.

public interface IAlphaVantageClient
Extension Methods

Remarks

Implementations of this interface enable applications to retrieve market data, such as stock prices, currency exchange rates, and technical indicators, from the Alpha Vantage platform. Methods and properties for specific data retrieval are defined in derived interfaces or implementations.

Methods

GetJsonDocumentAsync(AlphaVantageFunction, IDictionary<string, string>, CancellationToken)

Asynchronously retrieves a JSON document containing data from the Alpha Vantage API for the specified function and query parameters.

Task<JsonDocument> GetJsonDocumentAsync(AlphaVantageFunction function, IDictionary<string, string> queryParameters, CancellationToken cancellationToken = default)

Parameters

function AlphaVantageFunction

The Alpha Vantage function to query, which determines the type of financial data to retrieve.

queryParameters IDictionary<string, string>

A dictionary of query parameters to include in the API request. Keys and values must be valid Alpha Vantage parameters.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<JsonDocument>

A task that represents the asynchronous operation. The task result contains a JsonDocument with the requested data from Alpha Vantage.

GetJsonDocumentAsync(AlphaVantageFunction, string, CancellationToken)

Asynchronously retrieves a JSON document containing data from the Alpha Vantage API for the specified function and symbol.

Task<JsonDocument> GetJsonDocumentAsync(AlphaVantageFunction function, string symbol, CancellationToken cancellationToken = default)

Parameters

function AlphaVantageFunction

The Alpha Vantage function to query, which determines the type of financial data to retrieve.

symbol string

The symbol representing the financial instrument (such as a stock ticker) for which data is requested. Cannot be null or empty.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<JsonDocument>

A task that represents the asynchronous operation. The task result contains a JsonDocument with the requested data from Alpha Vantage.

GetJsonStringAsync(AlphaVantageFunction, IDictionary<string, string>, CancellationToken)

Asynchronously retrieves the raw JSON response for the specified Alpha Vantage function and query parameters.

Task<string> GetJsonStringAsync(AlphaVantageFunction function, IDictionary<string, string> queryParameters, CancellationToken cancellationToken = default)

Parameters

function AlphaVantageFunction

The Alpha Vantage API function to query. Determines the type of financial data returned.

queryParameters IDictionary<string, string>

A dictionary of query parameters to include in the API request. Keys and values must be valid Alpha Vantage parameters.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<string>

A task that represents the asynchronous operation. The task result contains the raw JSON string returned by the Alpha Vantage API.

GetJsonStringAsync(AlphaVantageFunction, string, CancellationToken)

Asynchronously retrieves the raw JSON response for the specified Alpha Vantage function and symbol.

Task<string> GetJsonStringAsync(AlphaVantageFunction function, string symbol, CancellationToken cancellationToken = default)

Parameters

function AlphaVantageFunction

The Alpha Vantage API function to query. Determines the type of financial data returned.

symbol string

The symbol representing the financial instrument to query. Must be a valid Alpha Vantage symbol; cannot be null or empty.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

Task<string>

A task that represents the asynchronous operation. The task result contains the raw JSON string returned by the Alpha Vantage API.