Quick Start
Prerequisites
- .NET 10 SDK and the
TigerBrokers.OpenAPINuGet package. - A Tiger OpenAPI application, Tiger ID, RSA private key, and token. Trading also requires an account and the relevant market permissions.
- Market-data visibility depends on region, account, exchange entitlement, and subscription. Use delayed quote operations without a real-time entitlement.
dotnet add package TigerBrokers.OpenAPIusing TigerOpenAPI.Common;
using TigerOpenAPI.Common.Enum;
using TigerOpenAPI.Config;
using TigerOpenAPI.Model;
using TigerOpenAPI.Quote;
using TigerOpenAPI.Quote.Model;
using TigerOpenAPI.Quote.Response;
TigerConfig config = new()
{
ConfigFilePath = "your_config_directory_path",
Language = Language.en_US,
TimeZone = CustomTimeZone.HK_ZONE,
AutoGrabPermission = false
};
QuoteClient quoteClient = new(config);
TigerRequest<MarketStateResponse> request = new()
{
ApiMethodName = QuoteApiService.MARKET_STATE,
ModelValue = new QuoteMarketModel { Market = Market.US }
};
MarketStateResponse? response = await quoteClient.ExecuteAsync(request);
if (response is null || !response.IsSuccess())
throw new InvalidOperationException(response?.Message ?? "empty response");
Console.WriteLine(response.Data);The exact asynchronous signature is Task<T?> ExecuteAsync<T>(TigerRequest<T> request) where T : TigerResponse; the synchronous variant is T? Execute<T>(TigerRequest<T> request). Handle both non-success Code values and null.
Updated 3 days ago
Did this page help you?
