binapi icon indicating copy to clipboard operation
binapi copied to clipboard

Cannot REST request binance futures market data by default?

Open andrewyuyang opened this issue 1 year ago • 1 comments

Hi, it seems to access binance futures market data, I had to modify for example

`api::result<klines_t> api::klines (const char* symbol, const char* interval, std::size_t limit, klines_cb cb) { const impl::init_list_type map = {{"symbol", symbol}, {"limit", limit}, {"interval", interval}};

return pimpl->post (false, "/api/v3/klines", boost::beast::http::verb::get, map, std::move (cb));

}` "/api/v3/klines" needs to be changed to "fapi/v1/klines"

Is this the right approach for now or am I missing something? I am relatively new to writing code.

Could someone with sufficient coding experience kindly optimize the code base so the the users of the library can choose to put these strings outside the library? I believe this is good also because binance could update their endpoints sometimes.

Thanks!

andrewyuyang avatar Jan 25 '25 15:01 andrewyuyang

See https://github.com/niXman/binapi/pull/90

2mhk avatar Feb 20 '25 06:02 2mhk