Crypto

Initialization

All examples on this page assume the following initialization has been completed:

from tigeropen.tiger_open_config import TigerOpenClientConfig

For details, see Prerequisites.


Get All Symbol List

QuoteClient.get_symbols(sec_type=SecurityType.CC)

Description

Retrieves the list of all crypto symbols.

Parameters

ParameterTypeRequiredDescription
sec_typestr or SecurityTypeYesFixed 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

ParameterTypeRequiredDescription
symbolslist[str]YesSymbols; maximum 50, e.g. ['BTC', 'ETH']
sec_typestr or SecurityTypeNoget_cc_briefs is an alias of get_stock_briefs and does not inject CC; pass SecurityType.CC explicitly
include_hour_tradingboolNoWhether to include pre-market/after-hours data
langLanguageNoOmission uses the QuoteClient configured language; fallback is en_US

Return

pandas.DataFrame

Structure:

COLUMNTypeDescription
symbolstrSymbol
openfloatOpen price
highfloatHigh price
lowfloatLow price
closefloatClose price
pre_closefloatPrevious close price
latest_pricefloatLatest price
latest_timeintLatest trade time, millisecond timestamp
ask_pricefloatAsk price
ask_sizeintAsk size
bid_pricefloatBid price
bid_sizeintBid size
volumeintTrading volume (integer)
volume_decimalfloatTrading volume (decimal, for crypto)
changefloatPrice change
change_ratefloatPrice change percentage
amplitudefloatAmplitude
adj_pre_closefloatAdjusted previous close
statusstrTrading 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

ParameterTypeRequiredDescription
symbolslist[str]YesSymbols; maximum 50 per request, for example ['AAPL', 'GOOG']
sec_typestr or SecurityTypeYesFixed as SecurityType.CC or "CC"
periodBarPeriodNobar period. Default BarPeriod.DAY, use enum constants from tigeropen.common.consts.BarPeriod: 1min, 60min, day, week, month
begin_timeint or strNoStart of the query range. Use a timestamp to avoid time zone ambiguity across markets
end_timeint or strNoEnd time for range query
limitintNoLimit number of records. Default 251, max 1200

Return

pandas.DataFrame

Structure:

ParameterTypeDescription
timeintMillisecond timestamp, e.g. 1639371600000
openfloatBar open price
closefloatBar close price
highfloatBar high price
lowfloatBar low price
volume_decimalfloatBar 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

ParameterTypeRequiredDescription
symbolslist[str]YesSymbols; maximum 10 per request
begin_timestrNoStart 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_typestr or SecurityTypeYesFixed as SecurityType.CC or "CC"

Return

pandas.DataFrame

Structure:

COLUMNTypeDescription
symbolstrSymbol code, e.g. AAPL
timeintMillisecond timestamp, e.g. 1639386000000
pricefloatClose price for the current minute
avg_pricefloatVolume-weighted average price up to current time
volume_decimalfloatVolume 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.


Did this page help you?