Requests, Responses, and Operations

TigerRequest<T> requires T : TigerResponse. Set ApiMethodName to a service constant and ModelValue to the operation's ApiModel. The client fills Tiger ID, timestamp, signature, and device ID. ApiVersion, charset, and sign type default to SDK constants.

QuoteApiService and TradeApiService are not network clients. IsQuoteApi/IsTradeApi only validate operation names. Network calls are QuoteClient.Execute[Async] and TradeClient.Execute[Async].

Every response has Code, Message, Timestamp, Sign, and IsSuccess(). Read each concrete class's Data, which may be strongly typed, a list, Dictionary<string, object>, or object.

  • Retry count comes from TigerConfig.FailRetryCounts; business failures are not retryable network failures.
  • Synchronous order placement and token refresh bypass automatic retry.
  • Server-side batch, date-window, page, and rate limits depend on operation and entitlement.
  • Quote, trading, options, futures, depth, and streaming permissions are separate.

Protocol-field models

Five server operations are registered in QuoteApiService but have no dedicated request class in C# SDK 1.2.3. An anonymous object cannot be assigned to TigerRequest.ModelValue; define small ApiModel subclasses. Use the complete definitions in the paired Chinese page or the equivalent declarations below.

using Newtonsoft.Json;
using TigerOpenAPI.Common.Enum;
using TigerOpenAPI.Model;

public sealed class StockDetailModel : ApiModel
{
    [JsonProperty(PropertyName = "symbols")]
    public List<string> Symbols { get; set; } = new();
    [JsonProperty(PropertyName = "sec_type", NullValueHandling = NullValueHandling.Ignore)]
    public string? SecType { get; set; }
}

public sealed class OptionTimelineQuery
{
    [JsonProperty(PropertyName = "symbol")]
    public string Symbol { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "expiry")]
    public long Expiry { get; set; }
    [JsonProperty(PropertyName = "right")]
    public string Right { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "strike")]
    public string Strike { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "begin_time", NullValueHandling = NullValueHandling.Ignore)]
    public long? BeginTime { get; set; }
}

public sealed class OptionTimelineModel : ApiModel
{
    [JsonProperty(PropertyName = "option_query")]
    public List<OptionTimelineQuery> OptionQuery { get; set; } = new();
    [JsonProperty(PropertyName = "market")]
    public Market Market { get; set; }
}

public sealed class IndustryListModel : ApiModel
{
    [JsonProperty(PropertyName = "industry_level", NullValueHandling = NullValueHandling.Ignore)]
    public string? IndustryLevel { get; set; }
}

public sealed class IndustryStocksModel : ApiModel
{
    [JsonProperty(PropertyName = "industry_id")]
    public string IndustryId { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "market", NullValueHandling = NullValueHandling.Ignore)]
    public string? Market { get; set; }
}

public sealed class StockIndustryModel : ApiModel
{
    [JsonProperty(PropertyName = "symbol")]
    public string Symbol { get; set; } = string.Empty;
    [JsonProperty(PropertyName = "market", NullValueHandling = NullValueHandling.Ignore)]
    public string? Market { get; set; }
    [JsonProperty(PropertyName = "sec_type", NullValueHandling = NullValueHandling.Ignore)]
    public string? SecType { get; set; }
}

Did this page help you?