Get Contracts
Get Contract
Signature
pub async fn get_contract(&self, symbol: &str, sec_type: &str) -> Result<Vec<Contract>, TigerError>Description
Get contract information for a single symbol.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| symbol | &str | Required | None |
| sec_type | &str | Required; supported values: STK, OPT, WAR, IOPT, FUT, FUND, CC | None |
Response
Result<Vec<Contract>, TigerError>
| Field | Type | Description |
|---|---|---|
| contract_id | Option<i64> | Contract ID |
| symbol | String | Symbol |
| sec_type | String | Security type |
| currency | Option<String> | Currency |
| exchange | Option<String> | Exchange |
| primary_exchange | Option<String> | Primary exchange |
| expiry | Option<String> | Expiration date |
| strike | Option<f64> | Strike price |
| right | Option<String> | PUT/CALL |
| multiplier | Option<f64> | Contract multiplier |
| identifier | Option<String> | Unique identifier |
| name | Option<String> | Name |
| market | Option<String> | Market |
| tradeable | Option<bool> | Whether tradeable |
| lot_size | Option<f64> | Lot size |
| tick_sizes | Option<Vec<TickSize>> | Tick size list |
| conid | Option<i64> | Internal contract ID |
| short_margin | Option<f64> | Short margin ratio |
| short_initial_margin | Option<f64> | Short initial margin ratio |
| short_maintenace_margin | Option<f64> | Short maintenance margin ratio; Rust field spelling is retained from the SDK |
| long_initial_margin | Option<f64> | Long initial margin |
| long_maintenace_margin | Option<f64> | Long maintenance margin; Rust field spelling is retained from the SDK |
TickSize fields:
| Field | Rust type | Description |
|---|---|---|
| begin | Option<String> | Range start price |
| end | Option<String> | Range end price |
| tick_size | Option<f64> | Minimum tick size |
| r#type | Option<String> | Range type |
Example
use tigeropen::config::ClientConfig;
use tigeropen::trade::TradeClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = ClientConfig::builder().build()?;
let trade = TradeClient::from_config(config);
let contracts = trade.get_contract("AAPL", "STK").await?;
for c in &contracts {
println!("{} {} exchange={:?}", c.symbol, c.sec_type, c.exchange);
}
Ok(())
}Response Example
[
{
"contractId": 11234,
"symbol": "AAPL",
"secType": "STK",
"currency": "USD",
"exchange": "SMART",
"primaryExchange": "NASDAQ",
"market": "US",
"tradeable": true,
"lotSize": 1.0,
"multiplier": 1.0
}
]Rate limit
The base rate limit is 60 requests/min.
Get Contracts (Batch)
Signature
pub async fn get_contracts(&self, symbols: &[&str], sec_type: &str) -> Result<Vec<Contract>, TigerError>Description
Get contract information for multiple symbols.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| symbols | &[&str] | Required | None |
| sec_type | &str | Required; only STK, FUT, and CC are supported | None |
Response
Same fields as Get Contract, including the Contract and nested TickSize field tables.
Example
let contracts = trade.get_contracts(&["AAPL", "GOOG", "TSLA"], "STK").await?;
println!("Got {} contracts", contracts.len());Response example
[{"contractId":11234,"symbol":"AAPL","secType":"STK","currency":"USD","market":"US"}]Rate limit
The base rate limit is 60 requests/min.
Get Quote Contract
Signature
pub async fn get_quote_contract(&self, symbol: &str, sec_type: &str, expiry: &str) -> Result<Vec<Contract>, TigerError>Description
Get quote contracts for options, warrants, or CBBCs.
Parameters
| Parameter | Rust type | Requirement | SDK default |
|---|---|---|---|
| symbol | &str | Required | None |
| sec_type | &str | Required; only OPT, WAR, and IOPT are supported | None |
| expiry | &str | Required for OPT; may be an empty string for WAR/IOPT; accepts yyyyMMdd or yyyy-MM-dd | None |
Response
Same fields as Get Contract, including the Contract and nested TickSize field tables. Derivatives commonly also include strike/expiry/right/identifier.
Example
let contracts = trade.get_quote_contract("AAPL", "OPT", "20260919").await?;
for c in &contracts {
println!("{} strike={:?} right={:?}", c.symbol, c.strike, c.right);
}Response Example
[
{
"contractId": 55678,
"symbol": "AAPL",
"secType": "OPT",
"currency": "USD",
"exchange": "SMART",
"expiry": "20260919",
"strike": 200.0,
"right": "CALL",
"multiplier": 100.0,
"identifier": "AAPL 260919C00200000"
}
]Rate limit
The base rate limit is 60 requests/min. get_quote_contract and get_derivative_contracts both use quote_contract and share this quota.
Updated about 1 month ago
