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
Query Parameters
{
price: number, // price in sun
available_energy_amount: number, // available resource amount at this price
}[]
Example
[
{
"price": -1,
"available_energy_amount": 177451
},
{
"price": 30,
"available_energy_amount": 331088
},
{
"price": 35,
"available_energy_amount": 2841948
},
]
Example Code
const GetOrderBook = async (api_key, receiver_address) => {
const url = `https://api.tronsave.io/v0/order-book?address=${receiver_address}`
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
}
curl 'https://api.tronsave.io/v0/order-book?address={{receiver_address}} \
--header 'apikey: {{apikey}}'