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

Method fetch_ticker

python/ccxt/latoken.py:706–743  ·  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://api.latoken.com/doc/v2/#tag/Ticker/operation/getTicker :param str symbol: unified symbol of the market to fetch the ticker for :pa

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

Source from the content-addressed store, hash-verified

704 }, market)
705
706 def fetch_ticker(self, symbol: str, params={}) -> Ticker:
707 """
708 fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
709
710 https://api.latoken.com/doc/v2/#tag/Ticker/operation/getTicker
711
712 :param str symbol: unified symbol of the market to fetch the ticker for
713 :param dict [params]: extra parameters specific to the exchange API endpoint
714 :returns dict: a `ticker structure <https://docs.ccxt.com/?id=ticker-structure>`
715 """
716 self.load_markets()
717 market = self.market(symbol)
718 request = {
719 'base': market['baseId'],
720 'quote': market['quoteId'],
721 }
722 response = self.publicGetTickerBaseQuote(self.extend(request, params))
723 #
724 # {
725 # "symbol": "92151d82-df98-4d88-9a4d-284fa9eca49f/0c3a106d-bde3-4c13-a26e-3fd2394529e5",
726 # "baseCurrency": "92151d82-df98-4d88-9a4d-284fa9eca49f",
727 # "quoteCurrency": "0c3a106d-bde3-4c13-a26e-3fd2394529e5",
728 # "volume24h": "165723597.189022176000000000",
729 # "volume7d": "934505768.625109571000000000",
730 # "change24h": "0.0200",
731 # "change7d": "-6.4200",
732 # "amount24h": "6438.457663100000000000",
733 # "amount7d": "35657.785013800000000000",
734 # "lastPrice": "25779.16",
735 # "lastQuantity": "0.248403300000000000",
736 # "bestBid": "25778.74",
737 # "bestBidQuantity": "0.6520232",
738 # "bestAsk": "25779.17",
739 # "bestAskQuantity": "0.4956043",
740 # "updateTimestamp": "1693965231406"
741 # }
742 #
743 return self.parse_ticker(response, market)
744
745 def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
746 """

Callers

nothing calls this directly

Calls 5

parse_tickerMethod · 0.95
load_marketsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected