Get Contracts
State-changing operations must prevent duplicate submission.
Get Contract
Operation
TradeApiService.CONTRACT = contract. Uses server method contract.
Request
TigerRequest<ContractResponse>ModelValue: ContractModel.
Parameters
| SDK property | C# type | API field | SDK default | Required | Constraints |
|---|---|---|---|---|---|
Lang | Language | lang | None (omitted if not set) | no | — |
Account | string (nullable) | account | null | Auto-filled if empty | TradeClient uses DefaultAccount when empty |
SecretKey | string | secret_key | null | no | — |
SecType | string | sec_type | TigerOpenAPI.Common.Enum.SecType.STK.ToString() | Optional | — |
Currency | string | currency | null | Optional | — |
Right | string | right | null | Optional | — |
Strike | Double | strike | None (omitted if not set) | Optional | — |
Expiry | string | expiry | null | Optional | — |
Exchange | string | exchange | null | Optional | — |
Symbol | string | symbol | null | Required | — |
Return
ContractResponse inherits TigerResponse; its data property is ContractItem. Key SDK fields: ContractId: Int32, Identifier: string, Symbol: string, SecType: string, Expiry: string, ContractMonth: string, Strike: Double, Right: string.
Example
TigerRequest<ContractResponse> request = new()
{
ApiMethodName = TradeApiService.CONTRACT,
ModelValue = new ContractModel { Account = tradeClient.GetDefaultAccount, SecType = "STK", Currency = "USD", Strike = 200.0, Symbol = "AAPL" }
};
ContractResponse? response = await tradeClient.ExecuteAsync(request);Response type
ContractItem? data = response?.Data; // null when response or data is absentResponse Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{
"symbol": "AAPL",
"secType": "STK",
"exchange": "SMART",
"market": "US",
"lotSize": 1,
"currency": "USD",
"name": "Apple Inc"
}
]
}Related APIs
See Requests, responses, and operations.
Get Contracts
Operation
TradeApiService.CONTRACTS = contracts. Uses server method contracts.
Request
TigerRequest<ContractsResponse>ModelValue: ContractsModel.
Parameters
| SDK property | C# type | API field | SDK default | Required | Constraints |
|---|---|---|---|---|---|
Lang | Language | lang | None (omitted if not set) | no | — |
Account | string (nullable) | account | null | Auto-filled if empty | TradeClient uses DefaultAccount when empty |
SecretKey | string | secret_key | null | no | — |
SecType | string | sec_type | TigerOpenAPI.Common.Enum.SecType.STK.ToString() | Optional | — |
Currency | string | currency | null | Optional | — |
Right | string | right | null | Optional | — |
Strike | Double | strike | None (omitted if not set) | Optional | — |
Expiry | string | expiry | null | Optional | — |
Exchange | string | exchange | null | Optional | — |
Symbols | list of string | symbols | null | Required | Non-empty list |
Return
ContractsResponse inherits TigerResponse; its data property is dictionary from string to list of ContractItem. Key SDK fields: dynamic fields.
Example
TigerRequest<ContractsResponse> request = new()
{
ApiMethodName = TradeApiService.CONTRACTS,
ModelValue = new ContractsModel { Account = tradeClient.GetDefaultAccount, SecType = "STK", Currency = "USD", Strike = 200.0, Symbols = new List<string> { "AAPL" } }
};
ContractsResponse? response = await tradeClient.ExecuteAsync(request);Response type
Dictionary<string, List<ContractItem>>? data = response?.Data; // null when response or data is absentRelated APIs
Updated 1 day ago
