Asset Prices
Request price info in realtime. The request needs to provide a price pair for specific asset.
Method
GET https://api.ninjapay.me/tapi/v1/assetPrice
Parameters
pricePair?: string
// Optional asset symbol input to get a single asset price, pass the symbol "BTC", "ETH", "SOL", "USDT"...
Response
// Dont pass any body to get all three pairs.
{
"status": true,
"data": {
"btc_usd": 39936, //<int>
"eth_usd": 39936, //<int>
"sol_usd": 39936, //<int>
"ltc_usd": 39936, //<int>
"usdt_usd": 1.001, //<int>
"usdt_inr": 83.3 //<int> // When USDT is passed in body param, response will have both usdt_usd and usdt_inr price.
},
"message": βPricing dataβ
}
Example
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'API_KEY'
},
body: '{"pricePair":"BTC"}'
};
fetch('https://api.ninjapay.me/tapi/v1/assetPrice', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Last updated