Go SDK

Tiger Open API Go SDK, providing market data queries, order placement, account management, and real-time push notifications.

Installation

go get github.com/tigerfintech/openapi-go-sdk

Requires Go 1.20 or higher.

Configuration

The SDK supports three configuration methods. Priority: Environment Variables > Code Settings (including config file) > Defaults.

Method 1: Load from properties file

cfg, err := config.NewClientConfig(
	config.WithPropertiesFile("tiger_openapi_config.properties"),
)

Configuration file format:

tiger_id=your_developer_id
private_key=your_rsa_private_key
account=your_trading_account

Method 2: Set directly in code

cfg, err := config.NewClientConfig(
	config.WithTigerID("your_tiger_id"),
	config.WithPrivateKey("your_rsa_private_key"),
	config.WithAccount("your_trading_account"),
)

Method 3: Environment variables

export TIGEROPEN_TIGER_ID=your_developer_id
export TIGEROPEN_PRIVATE_KEY=your_rsa_private_key
export TIGEROPEN_ACCOUNT=your_trading_account

Configuration Options

OptionDescriptionRequiredDefault
tiger_idDeveloper IDYes-
private_keyRSA private keyYes-
accountTrading accountNo-
languageLanguage (zh_CN/zh_TW/en_US)Nozh_CN
timeoutRequest timeoutNo15s