Convert Prices
Converts an amount from one currency to another using current market prices. Supports conversions between fiat and cryptocurrencies.
GET
https://api.kingpay.online/convert/ Use this endpoint when both the source and target currencies are defined via query parameters.
Query parameters
value— amount in thefromcurrency.from— source currency code (crypto symbol or fiat code).to— target currency code (crypto symbol or fiat code).
Both from and to may be:
- Cryptocurrency symbols:
BTC,ETH,LTC,USDT - Fiat codes:
USD,EUR,PLN,GBP
Response
{
"status": "success",
"exchange_rate": "0.9152000000000000",
"value_coin": "91.52"
}exchange_rate— amount oftoper 1from.value_coin— converted value in thetocurrency.
Examples
# Convert 100 USD to EUR
GET /convert/?value=100&from=USD&to=EUR
# Convert 0.01 BTC to USD
GET /convert/?value=0.01&from=BTC&to=USD
# Convert 1 BTC to ETH
GET /convert/?value=1&from=BTC&to=ETH