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

Method fetch_ticker

python/ccxt/bydfi.py:927–945  ·  view source on GitHub ↗

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market https://developers.bydfi.com/en/futures/market#24hr-price-change-statistics :param str symbol: unified symbol of the market to fetch the ticker fo

(self, symbol: str, params={})

Source from the content-addressed store, hash-verified

925 return self.parse_tickers(data, symbols)
926
927 def fetch_ticker(self, symbol: str, params={}) -> Ticker:
928 """
929 fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
930
931 https://developers.bydfi.com/en/futures/market#24hr-price-change-statistics
932
933 :param str symbol: unified symbol of the market to fetch the ticker for
934 :param dict [params]: extra parameters specific to the exchange API endpoint
935 :returns dict: a `ticker structure <https://docs.ccxt.com/?id=ticker-structure>`
936 """
937 self.load_markets()
938 market = self.market(symbol)
939 request = {
940 'symbol': market['id'],
941 }
942 response = self.publicGetV1FapiMarketTicker24hr(self.extend(request, params))
943 data = self.safe_list(response, 'data', [])
944 ticker = self.safe_dict(data, 0, {})
945 return self.parse_ticker(ticker, market)
946
947 def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
948 #

Callers

nothing calls this directly

Calls 7

parse_tickerMethod · 0.95
safe_listMethod · 0.80
safe_dictMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected