In this project, we are interested in the user’s private history of trades. Our goal will be to fetch the user’s record of trades to help with accounting. Keep in mind that this is not a complete example of what one would want to do with the data — it’s the starting point.

Introduction to Binance API and the “myTrades” rest endpoint

Our goal is to get the user’s private data, the history of trades. Since this is private information, it will depend on an initial authentication step. Remember that these steps depend on interaction with Binance API ( check Binance API docs to check the API version).

Momentarily, take aside the necessary authentication procedures. Assuming that the authentication went through, the most direct form of accessing this endpoint depends on an HTTP call using GET method:

GET /api/v3/myTrades

Developers usually create abstractions on top of these basic methods. One example is the following method,  binance.trades, available from Node-Binance-API NPM module:

binance.trades("SNMBTC", (error, trades, symbol) => {
  console.info(symbol+" trade history", trades);
});

#binance-api #programming #trade-management #software-development #nodejs

Using Binance API to Get The User’s Trading History
7.25 GEEK