Crypto
Initialization
All examples on this page assume the following initialization has been completed:
from tigeropen.tiger_open_config import TigerOpenClientConfigFor details, see Prerequisites.
Get All Symbol List
QuoteClient.get_symbols(sec_type=SecurityType.CC)
Description
Retrieves the list of all crypto symbols.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| sec_type | str or SecurityType | Yes | Fixed as SecurityType.CC or "CC" |
Return
Type
list
Example
from tigeropen.common.consts import SecurityType
symbols = quote_client.get_symbols(sec_type=SecurityType.CC)
print(symbols)Example Response
['APT.USD', 'IOTX.USD', 'USDT.USD', 'DYDX.USD', 'DOGE.USD', 'KAIA.USD', 'ATOM.USD', 'COMP.USD', 'UNI.USD', 'AAVE.USD', 'LDO.USD', 'LINK.USD', 'SNX.USD', 'OP.USD', 'DOT.USD', 'POL.USD', 'BTC.USD', 'SOL.USD', 'ARB.USD', 'TON.USD', 'AVAX.USD', 'MKR.USD', 'IMX.USD', 'ETH.USD', 'LTC.USD']
Rate Limit
The base rate limit is 10 requests/minute. Stock and cryptocurrency get_symbols() calls map to the same wire method and share this limit.
Get Real-Time Quotes
QuoteClient.get_cc_briefs(symbols, include_hour_trading=False, lang=None, sec_type=None)
Description
Retrieves real-time cryptocurrency quotes.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | list[str] | Yes | Symbols; maximum 50, e.g. ['BTC', 'ETH'] |
| sec_type | str or SecurityType | No | get_cc_briefs is an alias of get_stock_briefs and does not inject CC; pass SecurityType.CC explicitly |
| include_hour_trading | bool | No | Whether to include pre-market/after-hours data |
| lang | Language | No | Omission uses the QuoteClient configured language; fallback is en_US |
Return
pandas.DataFrame
Structure:
| COLUMN | Type | Description |
|---|---|---|
| symbol | str | Symbol |
| open | float | Open price |
| high | float | High price |
| low | float | Low price |
| close | float | Close price |
| pre_close | float | Previous close price |
| latest_price | float | Latest price |
| latest_time | int | Latest trade time, millisecond timestamp |
| ask_price | float | Ask price |
| ask_size | int | Ask size |
| bid_price | float | Bid price |
| bid_size | int | Bid size |
| volume | int | Trading volume (integer) |
| volume_decimal | float | Trading volume (decimal, for crypto) |
| change | float | Price change |
| change_rate | float | Price change percentage |
| amplitude | float | Amplitude |
| adj_pre_close | float | Adjusted previous close |
| status | str | Trading status |
Example
import pandas as pd
from tigeropen.common.consts import SecurityType
result = quote_client.get_cc_briefs(symbols=['BTC', 'ETH'], sec_type=SecurityType.CC)
print(result)Example Response
symbol open high low close pre_close latest_price latest_time \
0 BTC 71127.62 72200.0 69955.91 70932.55 71061.02 70932.55 1770608250067
1 ETH 2107.21 2148.9 2054.05 2089.56 2106.26 2089.56 1770608250068
ask_price ask_size bid_price bid_size volume volume_decimal change change_rate amplitude adj_pre_close status
0 70935.00 1 70930.00 2 135824 135.82381 -128.47 -0.001808 0.0316 71061.02 NORMAL
1 2090.00 5 2089.00 3 281559 2815.58590 -16.70 -0.007929 0.0450 2106.26 NORMAL
Rate Limit
The base rate limit is 120 requests/minute. get_stock_briefs() and get_cc_briefs() map to the same wire method and share this limit.
Get Candlestick Bars
QuoteClient.get_bars(symbols, sec_type=SecurityType.CC, period=BarPeriod.DAY, begin_time=-1, end_time=-1, limit=251)
Description
Retrieves cryptocurrency candlestick bars (K-line data) at 1-minute, 60-minute, daily, weekly, and monthly intervals. Each request returns at most 1,200 records. For a longer range, request consecutive date ranges. The API accepts either a date range or a specific date.
Minute bars for BTC are available from March 27, 2024. Daily and longer-period bars are available from July 13, 2010.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | list[str] | Yes | Symbols; maximum 50 per request, for example ['AAPL', 'GOOG'] |
| sec_type | str or SecurityType | Yes | Fixed as SecurityType.CC or "CC" |
| period | BarPeriod | No | bar period. Default BarPeriod.DAY, use enum constants from tigeropen.common.consts.BarPeriod: 1min, 60min, day, week, month |
| begin_time | int or str | No | Start of the query range. Use a timestamp to avoid time zone ambiguity across markets |
| end_time | int or str | No | End time for range query |
| limit | int | No | Limit number of records. Default 251, max 1200 |
Return
pandas.DataFrame
Structure:
| Parameter | Type | Description |
|---|---|---|
| time | int | Millisecond timestamp, e.g. 1639371600000 |
| open | float | Bar open price |
| close | float | Bar close price |
| high | float | Bar high price |
| low | float | Bar low price |
| volume_decimal | float | Bar volume with decimal precision |
Crypto returns decimal volume in volume_decimal and may omit the integer volume field. Stocks return integer volume and do not return volume_decimal.
Example
import pandas as pd
from tigeropen.common.consts import SecurityType
bars = quote_client.get_bars(['BTC.USD'], sec_type=SecurityType.CC)
Example Response
symbol open close high low volume_decimal time
0 BTC.USD 82808.12 82780.21 82808.12 82772.25 0.29135 1769749140000
1 BTC.USD 82810.81 82803.37 82810.81 82803.37 0.04455 1769749080000
2 BTC.USD 82823.91 82810.17 82823.91 82791.82 0.04930 1769749020000
Rate Limit
The base rate limit is 60 requests/minute. Stock and cryptocurrency get_bars() calls map to the same wire method and share this limit.
Get Intraday Time-Series Data
QuoteClient.get_timeline(symbols, sec_type=SecurityType.CC, begin_time=-1)
Description
Retrieves one record per minute for the most recent trading day. Historical trading days are not supported.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | list[str] | Yes | Symbols; maximum 10 per request |
| begin_time | str | No | Start time for time-series data, supports millisecond timestamp or datetime string, e.g. 1639386000000 or '2019-06-07 23:00:00' or '2019-06-07', defaults to current day |
| sec_type | str or SecurityType | Yes | Fixed as SecurityType.CC or "CC" |
Return
pandas.DataFrame
Structure:
| COLUMN | Type | Description |
|---|---|---|
| symbol | str | Symbol code, e.g. AAPL |
| time | int | Millisecond timestamp, e.g. 1639386000000 |
| price | float | Close price for the current minute |
| avg_price | float | Volume-weighted average price up to current time |
| volume_decimal | float | Volume for this minute with decimal precision |
The current crypto timeline returns decimal volume in volume_decimal and may omit the integer volume field. This field does not apply to stocks or historical timelines.
Example
import pandas as pd
from tigeropen.common.consts import SecurityType
timeline = quote_client.get_timeline(['BTC.USD'], sec_type=SecurityType.CC)
Example Response
symbol pre_close trade_session time price volume_decimal
0 BTC.USD 77517.15 Regular 1770040440000 77917.75 0.01902
1 BTC.USD 77517.15 Regular 1770040500000 77999.83 0.06813
2 BTC.USD 77517.15 Regular 1770040560000 78150.00 0.06568
3 BTC.USD 77517.15 Regular 1770040620000 78159.46 0.07281
Rate Limit
The base rate limit is 120 requests/minute. Stock and cryptocurrency get_timeline() calls map to the same wire method and share this limit.
Updated 12 days ago
