Market tags
Every market has a market_tag - its identifier everywhere in the API:
{ "market_tag": "BINANCE_BTC_USDT", "exchange": "BINANCE", "base": "BTC", "quote": "USDT", … }Get it from GET /v1/markets, pass it wherever a market is referenced.
Treat it as opaque
Section titled “Treat it as opaque”The tag looks constructible. Don’t. Two real examples of why:
- Contract names can contain underscores (
BITGETUTACOIN_BTC_USD_BTCUSD_CM), so splitting a tag on_mis-parses real markets. - Some futures venues list contracts with empty names, so a “spot-looking” tag can be a
futures market.
market_typecomes from the data, never from the tag’s shape.
Everything you might want from inside a tag is already a field: exchange, base, quote,
market_type, and the contract object. Filter on those:
usdt_spot = [m for m in markets if m["quote"] == "USDT" and m["market_type"] == "spot"]