Get Order Book
To use this feature you must have the API key. Read here to view how to get our API key
Get order book by API key
GET
https://api.tronsave.io/v0/order-book
Rate limit: 15 requests per 1 second
Query Parameters
Name
Type
Description
address
string
energy reciver address
min_delegate_amount
number
The minimum amount of energy delegated from one provider.
duration_sec
number
order duration in seconds
{
price: number, // price in sun
available_energy_amount: number, // available resource amount at this price
}[]
Example
{
"apikey": <YOUR_API_KEY>
}
Example Code
const GetOrderBook = async (api_key, receiver_address) => {
const url = `https://api.tronsave.io/v0/order-book?address=${receiver_address}&min_delegate_amount=100000&duration_sec=86400`
const data = await fetch(url, {
headers: {
'apikey': api_key
}
})
const response = await data.json()
/**
* Example response
* @link https://docs.tronsave.io/buy-energy-on-telegram/using-api-key-to/get-order-book
[
{
"price": -1,
"available_energy_amount": 177451
},
{
"price": 30,
"available_energy_amount": 331088
},
{
"price": 35,
"available_energy_amount": 2841948
},
]
*/
return response
}
Last updated