Binance API list all symbols with their names from a public endpoint
Asked Answered
S

2

10

I've integrated the Binance API in my project to show a list of all supported symbols and their corresponding icon. However, I'm unable to fetch the symbols name/description.

For instance, I can fetch BTC-EUR, but I can't fetch 'Bitcoin' or similar through a public endpoint. At least, I haven't found the endpoint so far.

For now, I'm using a private endpoint (which is behind authentication) at /sapi/v1/margin/allAssets. This returns me the name/description for each symbol, but as you can imagine I want to prevent usage of private API tokens on fetching public information

{
    "assetFullName": "Bitcoin",   <----- This is what I'm looking on a public endpoint
    "assetName": "BTC",
    "isBorrowable": true,
    "isMortgageable": true,
    "userMinBorrow": "0.00000000",
     "userMinRepay": "0.00000000"
}

So, my question is whether there is a public endpoint available to fetch the same information? Right now, I'm using the endpoint /api/v3/exchangeInfo to retrieve the available symbols on the exchange, but this response hasn't got the name/description of the symbol in it...

"symbols": [
    {
      "symbol": "ETHBTC",
      "status": "TRADING",
      "baseAsset": "ETH",
      "baseAssetPrecision": 8,
      "quoteAsset": "BTC",
      "quotePrecision": 8,
      "quoteAssetPrecision": 8,
      "orderTypes": [
        "LIMIT",
        "LIMIT_MAKER",
        "MARKET",
        "STOP_LOSS",
        "STOP_LOSS_LIMIT",
        "TAKE_PROFIT",
        "TAKE_PROFIT_LIMIT"
      ],
      "icebergAllowed": true,
      "ocoAllowed": true,
      "isSpotTradingAllowed": true,
      "isMarginTradingAllowed": true,
      "filters": [
        //These are defined in the Filters section.
        //All filters are optional
      ],
      "permissions": [
         "SPOT",
         "MARGIN"
      ]
    }
  ]

I've already looked for public endpoints about listing assets, as that's usually the namespace other exchanges return this information for, but I can't find such an endpoint in the documentation of the Binance API

Selfpropulsion answered 18/8, 2021 at 16:51 Comment(5)
#55549999 - there's a couple of solutions on the problemEthyl
@MikeK.Shum this is not what I'm looking for? I'm looking for the asset-name (e.g. Bitcoin), not for the market-pair (e.g. BTCEUR). This information is available, I'm missing the asset-names on a public API endpointSelfpropulsion
Yeah, there's no endpoint for this for sure. We've solved it by caching the result of the /exchangeInfo method. There are baseAsset and quoteAsset on a symbol.Ethyl
@MikeK.Shum I think we are talking about different things here..? What has caching to do with a result-set that doesn't contain the required information?Selfpropulsion
BTW, not all symbols are available on the /sapi/v1/margin/allAssets endpoint, either. 158:515 (June 2022)Farl
F
2

I ran into this same frustrating mess. Binance US doesn't allow the /sapi/v1/margin/allAssets because MARGIN permissions aren't granted for US users (returns an 'Invalid Api-Key ID').

There is nothing else available in their SPOT accounts that gives this data.

What I ended up doing was pulling the data from CoinMarketCap via https://pro-api.coinmarketcap.com/v1/cryptocurrency/map?CMC_PRO_API_KEY=<your-API-key>

Check their API authentication documentation.

PROS: It's free w/ the Basic account (you will need an account and an active API key - 5 minutes, tops)

CONS: It's NOT a standard (there isn't one, that I can tell). It will work fine for BTC, but take a look at the symbol HOT -- there's a few of them. You will have to manually curate those to match Binance (I persisted the CMC Unique ID in addition to the symbol & name). It sucks, but Binance doesn't give basic data like the name of the currency, which is absurd.

Flippant answered 5/12, 2021 at 21:17 Comment(0)
A
1

You can

  1. Proxy the private enpoint through your app, so that your API key stays hidden from your users

  2. Use another data source such as Coinmarketcap as already mentioned in another answer

  3. Query undocumented public endpoints (list with just name per each symbol, detail with name and description) that they use on the web app and are likely to change

However there is currently no direct way to get a currency name and symbol through an officially documented public Binance API endpoint without authorization.

Arbor answered 5/6, 2022 at 21:11 Comment(1)
spot on. thank you, you deserved the bounty award. In case you know how to get the data from PRIVATE endpoint, I'd like to know that as well. I'll write a question and you supply the answer. BOUNTY on that as well.Farl

© 2022 - 2025 — McMap. All rights reserved.