MCPcopy Create free account
hub / github.com/ccxt/ccxt / fetch_tickers

Method fetch_tickers

python/ccxt/xt.py:1673–1755  ·  view source on GitHub ↗

fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market https://doc.xt.com/#market10ticker24h https://doc.xt.com/#futures_quotesgetAggTickers :param str [symbols]: unified symbols of th

(self, symbols: Strings = None, params={})

Source from the content-addressed store, hash-verified

1671 return self.parse_ticker(ticker, market)
1672
1673 def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
1674 """
1675 fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
1676
1677 https://doc.xt.com/#market10ticker24h
1678 https://doc.xt.com/#futures_quotesgetAggTickers
1679
1680 :param str [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
1681 :param dict params: extra parameters specific to the xt api endpoint
1682 :returns dict: an array of `ticker structures <https://docs.ccxt.com/en/latest/manual.html#ticker-structure>`
1683 """
1684 self.load_markets()
1685 market = None
1686 if symbols is not None:
1687 symbols = self.market_symbols(symbols)
1688 market = self.market(symbols[0])
1689 request = {}
1690 type = None
1691 subType = None
1692 response = None
1693 type, params = self.handle_market_type_and_params('fetchTickers', market, params)
1694 subType, params = self.handle_sub_type_and_params('fetchTickers', market, params)
1695 if subType == 'inverse':
1696 response = self.publicInverseGetFutureMarketV1PublicQAggTickers(self.extend(request, params))
1697 elif (subType == 'linear') or (type == 'swap') or (type == 'future'):
1698 response = self.publicLinearGetFutureMarketV1PublicQAggTickers(self.extend(request, params))
1699 else:
1700 response = self.publicSpotGetTicker24h(self.extend(request, params))
1701 #
1702 # spot
1703 #
1704 # {
1705 # "rc": 0,
1706 # "mc": "SUCCESS",
1707 # "ma": [],
1708 # "result": [
1709 # {
1710 # "s": "btc_usdt",
1711 # "t": 1678172693931,
1712 # "cv": "34.00",
1713 # "cr": "0.0015",
1714 # "o": "22398.05",
1715 # "l": "22323.72",
1716 # "h": "22600.50",
1717 # "c": "22432.05",
1718 # "q": "7962.256931",
1719 # "v": "178675209.47416856"
1720 # }
1721 # ]
1722 # }
1723 #
1724 # swap and future
1725 #
1726 # {
1727 # "returnCode": 0,
1728 # "msgInfo": "success",
1729 # "error": null,
1730 # "result": [

Callers 9

fetch_bids_asksMethod · 0.45
sync_clientFunction · 0.45
async_clientFunction · 0.45
latoken-example.pyFile · 0.45
get_last_pricesFunction · 0.45

Calls 13

parse_tickerMethod · 0.95
market_symbolsMethod · 0.80
safe_valueMethod · 0.80
filter_by_arrayMethod · 0.80
rangeFunction · 0.50
load_marketsMethod · 0.45
marketMethod · 0.45

Tested by

no test coverage detected