Exchange Calculate
This endpoint helps you instantly know how much cryptocurrency you'll get when exchanging from one type to another. Perfect for anyone interested in cryptocurrency, this feature is super easy to use. Just plug it into your app, and you'll always have the latest exchange rates at your fingertips. Whether you're buying or selling, the endpoint makes it simple to calculate the amount you'll receive in your desired cryptocurrency.
POST
https://api.oxapay.com/exchange/calculate
Request Body
Name | Type | Description |
---|---|---|
fromCurrency* | string | The currency code of the cryptocurrency you want to convert from |
toCurrency* | string | The currency code of the cryptocurrency you want to convert to |
amount* | decimal | Amount you want to exchange |
Example codes
Usage
By inputting the amount
, fromCurrency
, and toCurrency
parameters, you can instantly fetch the exchange rate between your chosen cryptocurrencies and determine the amount in your desired currency. For instance, if you specify an amount
of 0.2 with fromCurrency
set to "BTC" and toCurrency
set to "USDT," the response will furnish the current BTC to USDT rate, along with the corresponding amount of USDT you'll receive after exchanging the specified BTC quantity. This feature simplifies the process of calculating cryptocurrency exchanges, providing real-time insights for informed decision-making.
Please note that the exchange rate provided in the response may fluctuate over time due to the volatile nature of cryptocurrency markets.
Last updated