Bitcoin Forum
December 06, 2026, 12:45:46 PM *
News: Latest Bitcoin Core release: 32.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Binance API symbolStatus in Node.js: keep delisted pairs out of price data  (Read 11 times)
sieblydev (OP)
Newbie
*
Offline

Activity: 2
Merit: 0


View Profile
December 05, 2026, 07:13:04 PM
 #1

Ask Binance for every Spot price with GET /api/v3/ticker/price and you get every pair the exchange has listed, not only the ones you can trade today. The list currently holds 3,766 entries, and only 1,388 of those symbols have the status TRADING. Most of the rest are in BREAK, and 1,770 of them still return a non-zero last price. EOSUSDT, for example, still answers with 0.7799, so a scanner or price board that trusts the full list will show pairs nobody can trade.

Since October 2025 the Spot market data endpoints accept a symbolStatus parameter, so Binance can do that filtering on the server.

The status values (Binance Spot glossary)
  • TRADING: orders can be placed.
  • HALT: not available for trading, for example during emergency downtime. Market data is still generated.
  • BREAK: not available for trading. Market data is not generated. Delisted pairs sit here.
  • CANCEL_ONLY: only cancels and amends are accepted. Market data is still generated, except klines. Added in July 2026.
Where symbolStatus works
REST: /api/v3/depth, /api/v3/ticker/price, /api/v3/ticker/bookTicker, /api/v3/ticker/24hr, /api/v3/ticker/tradingDay and /api/v3/ticker. The WebSocket API has the same parameter on depth, ticker.price, ticker.book, ticker.24hr, ticker.tradingDay and ticker.

It behaves differently depending on how many symbols you ask for:
  • No symbol, or a symbols list: symbols with another status are simply left out. If none match, the response is an empty array.
  • A single symbol with another status: the request fails with -1220 SYMBOL_DOES_NOT_MATCH_STATUS.
That second rule is handy. Without the filter, GET /api/v3/depth for a delisted pair returns a valid but empty book (no bids, no asks), which is easy to mistake for a quiet market. With symbolStatus=TRADING you get a clear error instead.

Node.js example
npm install binance, then save this as symbol-status.mjs. Public market data needs no API key.

Code:
import { MainClient } from 'binance';

export const client = new MainClient();

// How many Spot symbols are in each status right now
export async function statusCounts() {
  const { symbols } = await client.getExchangeInfo();
  const counts = {};
  for (const s of symbols) counts[s.status] = (counts[s.status] || 0) + 1;
  return counts;
}

// Prices for a watchlist; pairs that are not TRADING are dropped, no error
export function tradingPrices(symbols) {
  return client.getSymbolPriceTicker({ symbols, symbolStatus: 'TRADING' });
}

// One symbol: null when the pair exists but is not TRADING
export async function priceIfTrading(symbol) {
  try {
    return await client.getSymbolPriceTicker({ symbol, symbolStatus: 'TRADING' });
  } catch (e) {
    if (e?.code === -1220) return null;
    throw e;
  }
}

And a small script that uses it, run.mjs:

Code:
import { client, statusCounts, tradingPrices, priceIfTrading } from './symbol-status.mjs';

console.log('status counts', await statusCounts());

const all = await client.getSymbolPriceTicker();
const live = await client.getSymbolPriceTicker({ symbolStatus: 'TRADING' });
console.log('all prices', all.length, '| TRADING only', live.length);

console.log(await tradingPrices(['BTCUSDT', 'ETHUSDT', 'EOSUSDT']));
console.log('EOSUSDT', await priceIfTrading('EOSUSDT'));

const book = await client.getOrderBook({ symbol: 'BTCUSDT', limit: 5, symbolStatus: 'TRADING' });
console.log('BTCUSDT bids', book.bids.length);

Example output:

Code:
status counts { TRADING: 1388, BREAK: 2375 }
all prices 3766 | TRADING only 1388
[
  { symbol: 'BTCUSDT', price: '43369.43000000' },
  { symbol: 'ETHUSDT', price: '1323.51000000' }
]
EOSUSDT null
BTCUSDT bids 5

The same option works on getSymbolOrderBookTicker() and get24hrChangeStatistics(), which also return 1,388 symbols with symbolStatus: 'TRADING'.

When to still read exchangeInfo
symbolStatus keeps market data clean, but an order path still needs exchangeInfo: it carries the price and quantity filters, and a pair can move from TRADING to CANCEL_ONLY while your bot is running. A simple pattern is to refresh exchangeInfo on a timer, place new orders only on TRADING pairs, and still allow cancels and amends on CANCEL_ONLY pairs so open orders can be cleaned up.

More Binance examples for Node.js and TypeScript, including WebSocket streams and order placement: https://siebly.io/sdk/binance/javascript

(The examples use the binance npm package, which Siebly maintains.)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!