I checked all the functions I can think of but I don't see anything for this in the Binance C# API: https://github.com/JKorf/Binance.Net
All I want is to list the coins I am showing in a list view in the order of their market cap rank, if possible.
I checked all the functions I can think of but I don't see anything for this in the Binance C# API: https://github.com/JKorf/Binance.Net
All I want is to list the coins I am showing in a list view in the order of their market cap rank, if possible.
There is no "legal" way to get this data. This is how I do that:
https://www.binance.com/exchange-api/v2/public/asset-service/product/get-products
GET this endpoint. It used for Binance SPA and does not mention in their documentation.
data is an array that contains all trading Binance pairs. For example:
"s":"BTCUSDT",
"st":"TRADING",
"b":"BTC",
"q":"USDT",
"ba":"฿",
"a":"",
"I":"0.00000100",
"ts":"0.01",
"an":"Bitcoin",
"qn":"TetherUS",
"o":"46915.84",
"h":"47499.43",
"l":"44961.09",
"c":"46791.85",
"v":"91500.82",
"qv":"4248420233.17226301",
"y":0,
"as":91500.81462400,
"pm":"FIAT",
"pn":"FIAT",
"cs":18620881,
"tags":["pow","mining-zone"],
"pom":false,
"pomt":null,
"etf":false
You need to take the field cs and multiply it to the current asset price. In this case, it will be field c
18620881 * 46791.85 = 871,305M
So it's current BTC market cap
If you just need a free API and not necessarily Binance you could use CoinGecko's API. Check the docs here:
https://www.coingecko.com/api/documentations/v3
The endpoint you need is /coins/markets.
Try this out https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc
You may want to know the supported vs_currencies to set the vs_currency parameter. https://api.coingecko.com/api/v3/simple/supported_vs_currencies