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

ParameterRust typeRequirementSDK default
symbol&strRequiredNone
sec_type&strRequired; supported values: STK, OPT, WAR, IOPT, FUT, FUND, CCNone

Response

Result<Vec<Contract>, TigerError>

FieldTypeDescription
contract_idOption<i64>Contract ID
symbolStringSymbol
sec_typeStringSecurity type
currencyOption<String>Currency
exchangeOption<String>Exchange
primary_exchangeOption<String>Primary exchange
expiryOption<String>Expiration date
strikeOption<f64>Strike price
rightOption<String>PUT/CALL
multiplierOption<f64>Contract multiplier
identifierOption<String>Unique identifier
nameOption<String>Name
marketOption<String>Market
tradeableOption<bool>Whether tradeable
lot_sizeOption<f64>Lot size
tick_sizesOption<Vec<TickSize>>Tick size list
conidOption<i64>Internal contract ID
short_marginOption<f64>Short margin ratio
short_initial_marginOption<f64>Short initial margin ratio
short_maintenace_marginOption<f64>Short maintenance margin ratio; Rust field spelling is retained from the SDK
long_initial_marginOption<f64>Long initial margin
long_maintenace_marginOption<f64>Long maintenance margin; Rust field spelling is retained from the SDK

TickSize fields:

FieldRust typeDescription
beginOption<String>Range start price
endOption<String>Range end price
tick_sizeOption<f64>Minimum tick size
r#typeOption<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

ParameterRust typeRequirementSDK default
symbols&[&str]RequiredNone
sec_type&strRequired; only STK, FUT, and CC are supportedNone

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

ParameterRust typeRequirementSDK default
symbol&strRequiredNone
sec_type&strRequired; only OPT, WAR, and IOPT are supportedNone
expiry&strRequired for OPT; may be an empty string for WAR/IOPT; accepts yyyyMMdd or yyyy-MM-ddNone

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.


Did this page help you?