Price Ticker
Returns the prices for all countries based on the selected coin.
Returns the price ticker
POST https://api.onramp.money/onramp/api/v2/common/transaction/priceTicker
Request Body
Name
Type
Description
fiatType*
Integer
Fiat IDs such as 1, 2, etc., are used. Refer to the allCountry config for the corresponding mappings.
type*
Integer
1-> onramp, 2-> offramp, 3-> swap
Sample Request
var CryptoJS = require('crypto-js');
var axios = require('axios');
async function priceTicker() {
try {
let body = {
fiatType: 2,
type: 1
};
let payload = {
timestamp: new Date().getTime(),
body
}
let apiKey = 'API_KEY', apiSecret = 'API_SECRET'; // replace with your api credentials
payload = Buffer.from(JSON.stringify(payload)).toString('base64');
let signature = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA512(payload, apiSecret));
let options = {
url: 'https://api.onramp.money/onramp/api/v2/common/transaction/priceTicker',
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json;charset=UTF-8',
'X-ONRAMP-SIGNATURE': signature,
'X-ONRAMP-APIKEY': apiKey,
'X-ONRAMP-PAYLOAD': payload
},
data: body
};
let data = await axios(options)
console.log(data?.data);
} catch (error) {
console.log(error?.response?.data)
}
}
priceTicker();
status -> 0: Unsuccessful request, 1: Successful request.
data -> JSON object representing the price in fiat amounts mapped to specific coins for onramp/offramp transactions..
onramp/offramp: Indicating the fiat price associated with each coin during onramp/offramp transactions.
coinId: Unique identifier for a cryptocurrency (e.g., USDT, BTC, ETH).
amount: The corresponding price in fiatAmount
Last updated