Here’s a right code for the use of API Binance Node.js:
Related Open Subazles on Simvol with Node.js Api Binance.js
It is important to be the course of market data from cryptocurrency markets. One of the sake of helping this is the use of api binance node.js. Designs does not, access to the covered with the stubbits the decrees and the lining in the insignificance.
To get the open orders on the symbol from the API Binance, you can use the final point Getupenorders. Here's how to make:
Shag 1: Set out your midst
Receive what you have a node.js on your car, and also the unworthy packages:
Bash
NPM Install -g @Binance/Binary-Data-API
`
This is the installation package of API Binance in all the world.
Shag 2: Submit UC -Client Data File
To use the final point Getupenorders
, you need to enter the client’s dangers. This file is used by API for the authentification of your promotions. You can consume one, using your binance settings:
- Wojt in your Binance record.
- Submit B
STRAINE>
Security >
CLIENT SUCCESS .
- Pick up “Create new client cuts” and select the “base”.
- Enter the IDENTIGOR of the client and secrets of the client (this is taken for authentification).
Shag 3: Put the bell api
Now, when you have a centennial for a client, you can write a call api with node.js:
`Javascript
Const Binaancpp = Require ('@binance/binary-data-api');
Async Function Getupenorders (Simvol) {
ask {
// Setting up a client Binance API with an IDentifikator client and secret
Const Client = New Binaancpp.binanceClient ({
Clientid: 'Your_Client_id',
Clientscret: 'Your_Client_secret'
});
// Call in the final point getupenorders
Const Response = Wave Client.get ('Openorders', {
Simvol,
Predel: 10, // Reach up to 10 Opened Submitted at a time
Rynok: “Spot” // Show the Market (For example, place for ETHBTC)
});
Console.log (Response.data);
} Catch (error) {
Console.error (Oshba);
}
}
// Call the function with your symbol (ethbtc in this primer)
Getupenorders ('Ethbtc');
Shag 4: PROVIDED OBROBATILY
At the time of API, you can take the lights. To go right with them, you also have to connect the enlightenment code:
`Javascript
Async Function Getupenorders (Simvol) {
ask {
// Setting up a client Binance API with an IDentifikator client and secret
Const Client = New Binaancpp.binanceClient ({
Clientid: 'Your_Client_id',
Clientscret: 'Your_Client_secret'
});
// Call in the final point getupenorders
Const Response = Wave Client.get ('Openorders', {
Simvol,
Predel: 10, // Reach up to 10 Opened Submitted at a time
Rynok: “Spot” // Show the Market (For example, place for ETHBTC)
});
Console.log (Response.data);
} Catch (error) {
IF (error.code === 'BinanceClienter') {
Const Code = Error.code;
Const Message = Error.Message;
Switch (code) {
CONTROL 4003:
// Market is unworthy
redemption;
Black 4004:
// Settles
redemption;
Powers:
Console.error (co -provision);
Visit a new scoop (error: $ {Message});
}
} ELSE IF (Exanceof Exanceof Oshba) {
Console.error (Oshba);
}
}
}
The trace of this step and included the right -wing loop, you can firmly fake open orders for the Simvol from API Binance with the node.js.