coinDetails - price details for desired amount

Get details for a specific coin and desired amount

Note:

  • Supported Currencies: To view the list of all the fiat currencies supported by Onramp, click here.

  • Supported Payment Methods: To view the list of all the supported payment methods for various currencies supported by Onramp, click here.

GET https://api.onramp.money/onramp/api/v3/buy/public/coinDetails

Path Parameters

NameTypeDescription

coinCode*

usdt

Name of the coin (also denoted as key in data.allCoinConfig in the response returned in the listAllCoins endpoint) current supported coins:

usdt| usdc | busd | eth | bnb | matic | sol

chainId*

3

chainId from config file

fiatAmount*

100

Fiat Amount

fiatType*

1

Fiat Type from config file, fiat supported for the localised region 1 -> India (Default) INR

2 -> Turkey (TRY)

3 -> Arab Emirates Dirham (AED)

4 -> Mexican Peso (MXN)

5 -> Vietnamese dong (VND)

6 -> Nigerian Naira (NGN)

{
   "status":1,
   "code":200,
   "data":{
      "price":91.5,
      "gasFee":{
         "withdrawalFee":"0.14",
         "minimumWithdrawal":"0.15",
         "nodeInSync":1
      }
   }
}
const axios = require('axios');

const coinDetails = async (coinCode, chainId, fiatAmount, fiatType) => {
    try {
        const response = await axios.get(
          `https://api.onramp.money/onramp/api/v3/buy/public/coinDetails?coinCode=${coinCode}&chainId=${chainId}&fiatAmount=${fiatAmount}&fiatType=${fiatType}`
          );
        console.log(JSON.stringify(response.data, null, 2));
    } catch (error) {
        console.error(`Error: ${error}`);
    }
};

coinDetails('usdt', '3', '100', '1');
{
   "status":1,
   "code":200,
   "data":{
      "price":91.5,
      "gasFee":{
         "withdrawalFee":"0.14",
         "minimumWithdrawal":"0.15",
         "nodeInSync":1
      }
   }
}

Last updated