the price from api different from web

I use code like that to get the best price

public void  allBookTickSubscription(){
  BinanceClient.spotSubsptClient.onAllBookTickersEvent(bookTickerEvent -> {
    HashMap map = new HashMap();
    map.put(BeanConstant.BEST_ASK_PRICE,bookTickerEvent.getAskPrice());
    map.put(BeanConstant.BEST_ASK_Qty,bookTickerEvent.getAskQuantity());
    map.put(BeanConstant.BEST_BID_PRICE,bookTickerEvent.getBidPrice());
    map.put(BeanConstant.BEST_BID_QTY,bookTickerEvent.getBidQuantity());
    MarketCache.tickerMap.put(bookTickerEvent.getSymbol(),map);

    String symbol = "BTCUSDT";
    if(MarketCache.tickerMap.containsKey(symbol))
      System.out.println(MarketCache.tickerMap.get(symbol).get(BeanConstant.BEST_ASK_PRICE));
  });
} 

but the BTCUSDT price I get from code is quite different(48654 vs 48534) from the web.

  1. You should sub from btcusdt@bookTicker instead of all bookTickers if you are just interested in on symbol
  2. Not wise to read things and compare using your eyes. Those tickers change instantly and they’re from the same data resource

I want to monitor all symbols, what is the best way ro do?

In that case, use the method you’re using. But you cannot compare the data output from the console and compare it with web page and say they’re different. Just want to correct one thing I said: “委托订单” uses btcusdt@depth to update and it’s updated every second. And onAllBookTickersEvent gets updated on realtime.