Quick Start
Get started in 5 minutes by making your first market data request. Choose the Python SDK, Java SDK, or a no-code AI/MCP integration.
Prerequisites
- Open and fund a Tiger Brokers account.
- Activate Tiger OpenAPI access in the Developer Center to obtain your Tiger ID and private key.
For detailed steps, see Prepare.
Choose Your Integration Method
Step 1: Install the SDK
We recommend uv, a fast Python package manager:
uv pip install tigeropenOr use pip:
pip install tigeropenStep 2: Configure Credentials
Pass the path to the config file downloaded from the Developer Center:
from tigeropen.tiger_open_config import TigerOpenClientConfig
client_config = TigerOpenClientConfig(props_path='your_config_directory_path')Step 3: Retrieve Candlestick Data
from tigeropen.quote.quote_client import QuoteClient
from tigeropen.common.consts import BarPeriod
quote_client = QuoteClient(client_config)
# Query Apple daily candlestick (last 5 bars)
bars = quote_client.get_bars(['AAPL'], period=BarPeriod.DAY, limit=5)
print(bars[['symbol', 'time', 'open', 'high', 'low', 'close', 'volume']])Sample output:
symbol time open high low close volume
0 AAPL 1715731200000 189.50 191.20 188.80 190.10 52341000
1 AAPL 1715644800000 188.10 190.50 187.60 189.30 48120000Step 4: Query Positions
from tigeropen.trade.trade_client import TradeClient
from tigeropen.common.consts import SecurityType
trade_client = TradeClient(client_config)
positions = trade_client.get_positions(sec_type=SecurityType.STK)
for p in positions:
print(p.contract.symbol, p.quantity, p.average_cost, p.market_value)Next steps: Full feature examples · Market data APIs · Place orders
Step 1: Add Dependency
<dependency>
<groupId>io.github.tigerbrokers</groupId>
<artifactId>openapi-java-sdk</artifactId>
<version>2.4.1</version>
</dependency>implementation 'io.github.tigerbrokers:openapi-java-sdk:2.4.1'Step 2: Run the Complete Example
The following code initializes the client, retrieves candlestick data, and retrieves positions. You can run it as provided:
import com.tigerbrokers.stock.openapi.client.config.ClientConfig;
import com.tigerbrokers.stock.openapi.client.https.client.TigerHttpClient;
import com.tigerbrokers.stock.openapi.client.https.request.quote.QuoteKlineRequest;
import com.tigerbrokers.stock.openapi.client.https.request.trade.PositionsRequest;
import com.tigerbrokers.stock.openapi.client.https.response.quote.QuoteKlineResponse;
import com.tigerbrokers.stock.openapi.client.https.response.trade.PositionsResponse;
import com.tigerbrokers.stock.openapi.client.struct.enums.KType;
import com.tigerbrokers.stock.openapi.client.struct.enums.RightOption;
import com.tigerbrokers.stock.openapi.client.util.builder.AccountParamBuilder;
import java.util.Arrays;
public class QuickStart {
public static void main(String[] args) {
// Step 1: Initialize the client
// configFilePath is the directory containing tiger_openapi_config.properties
// downloaded from the Developer Center
ClientConfig clientConfig = ClientConfig.DEFAULT_CONFIG;
clientConfig.configFilePath = "your_config_directory_path";
TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(clientConfig);
// Step 2: Query Apple daily candlestick
QuoteKlineResponse klineResponse = client.execute(
QuoteKlineRequest.newRequest(Arrays.asList("AAPL"), KType.day, "2024-01-01", "2024-01-10")
.withLimit(5)
.withRight(RightOption.br)
);
if (klineResponse.isSuccess()) {
klineResponse.getKlineItems().forEach(item ->
item.getItems().forEach(point ->
System.out.println(item.getSymbol() + " " + point.getTime() + " close=" + point.getClose())
)
);
} else {
System.out.println("Kline query failed: " + klineResponse.getMessage());
}
// Step 3: Query positions
PositionsRequest posRequest = new PositionsRequest();
posRequest.setBizContent(AccountParamBuilder.instance()
.account(clientConfig.defaultAccount)
.secType("STK")
.buildJson());
PositionsResponse posResponse = client.execute(posRequest);
if (posResponse.isSuccess()) {
posResponse.getItem().getPositions().forEach(p ->
System.out.println(p.getSymbol() + " qty=" + p.getPositionQty() + " cost=" + p.getAverageCost())
);
} else {
System.out.println("Position query failed: " + posResponse.getMessage());
}
}
}Next steps: Full feature examples · Market data APIs · Place orders
Call Tiger OpenAPI directly through AI tools without writing SDK code. You can use all three options together; they are not mutually exclusive:
Not sure which option to choose? Use MCP for conversational requests, the CLI for scripts or scheduled tasks, and the AI Skill for more accurate AI-generated code.
MCP Server: Access Market Data and Trading from an AI Chat
Add the following configuration to mcp.json in Claude Desktop or Cursor, restart the application, and submit requests in natural language:
{
"mcpServers": {
"tiger-openapi": {
"command": "uvx",
"args": ["--python", "3.13", "tigermcp"],
"env": {
"TIGEROPEN_PROPS_PATH": "your_config_directory_path",
"TIGERMCP_READONLY": "true"
}
}
}
}Then say things like Get the latest price for AAPL directly in your AI chat. The configuration above enables read-only mode, so orders are not allowed. To enable trading, read the full setup guide first and explicitly turn read-only mode off.
CLI: Query Market Data and Manage Orders from the Terminal
# Install
pip install tigeropen
# Get AAPL real-time quote
tigeropen quote briefs AAPL
# View positions
tigeropen trade position listAI Skill: Improve AI-Generated Tiger OpenAPI Code
# Install Tiger OpenAPI domain knowledge for Claude Code / Cursor / Kiro
npx skills add tigerfintech/tigeropen-skillAfter installation, describe your task in your AI coding tool, for example, "Query AAPL candlestick data using the Python SDK." The generated code will use the appropriate APIs and parameters.
Other Language SDKs
In addition to Python and Java, Tiger OpenAPI also provides SDKs for the following languages:
| Language | Docs |
|---|---|
| C++ | Cpp SDK |
| C# | C# SDK |
| Go | Go SDK |
| TypeScript | TypeScript SDK |
| Rust | Rust SDK |
Need Help?
Use the Ask AI button in the top-right corner for quick answers.
Related documentation:
- Credential configuration → Prepare
- Market data permissions → Market Data Permissions & Limits
- Error code reference → Error Codes
- Contact support → Contact Us
Updated 2 days ago
