Search documentation

Find pages, endpoints, parameters, and guides.

Convert Price

View as Markdown

This method enables seamless price conversion between fiat currencies and cryptocurrencies, as well as between different cryptocurrencies, by passing the ticker as a GET parameter. This approach provides flexibility and clarity when managing multiple conversions programmatically.

Note:

  • Prices are fetched every 5 minutes from CoinMarketCap.

Method: GET

Path: https://api.cryptapi.io/convert/


Parameters

Query Parameters

valuenumber•Required

Value you wish to convert in the cryptocurrency/token of the ticker you are using.

Example:10

fromstring•Required

Specify the currency you wish to convert from, whether it is FIAT or cryptocurrency. Check our full list of supported cryptocurrencies.

Supported FIAT currencies:

  • (USD) United States Dollar
  • (EUR) Euro
  • (GBP) Great Britain Pound
  • (CAD) Canadian Dollar
  • (JPY) Japanese Yen
  • (AED) UAE Dollar
  • (MYR) Malaysian Ringgit
  • (IDR) Indonesian Rupiah
  • (THB) Thai Baht
  • (CHF) Swiss Franc
  • (SGD) Singapore Dollar
  • (RUB) Russian Ruble
  • (ZAR) South African Rand
  • (TRY) Turkish Lira
  • (LKR) Sri Lankan Rupee
  • (RON) Romanian Leu
  • (BGN) Bulgarian Lev
  • (HUF) Hungarian Forint
  • (CZK) Czech Koruna
  • (PHP) Philippine Peso
  • (PLN) Poland Zloti
  • (UGX) Uganda Shillings
  • (MXN) Mexican Peso
  • (INR) Indian Rupee
  • (HKD) Hong Kong Dollar
  • (CNY) Chinese Yuan
  • (BRL) Brazilian Real
  • (DKK) Danish Krone
  • (TWD) New Taiwan Dollar
  • (AUD) Australian Dollar
  • (NGN) Nigerian Naira
  • (SEK) Swedish Krona
  • (NOK) Norwegian Krone
  • (UAH) Ukrainian Hryvnia
  • (VND) Vietnamese Dong
Example:usd

tostring•Required

Specify the currency you wish to convert to, whether it is FIAT or cryptocurrency. Check our full list of supported cryptocurrencies.

Supported FIAT currencies:

  • (USD) United States Dollar
  • (EUR) Euro
  • (GBP) Great Britain Pound
  • (CAD) Canadian Dollar
  • (JPY) Japanese Yen
  • (AED) UAE Dollar
  • (MYR) Malaysian Ringgit
  • (IDR) Indonesian Rupiah
  • (THB) Thai Baht
  • (CHF) Swiss Franc
  • (SGD) Singapore Dollar
  • (RUB) Russian Ruble
  • (ZAR) South African Rand
  • (TRY) Turkish Lira
  • (LKR) Sri Lankan Rupee
  • (RON) Romanian Leu
  • (BGN) Bulgarian Lev
  • (HUF) Hungarian Forint
  • (CZK) Czech Koruna
  • (PHP) Philippine Peso
  • (PLN) Poland Zloti
  • (UGX) Uganda Shillings
  • (MXN) Mexican Peso
  • (INR) Indian Rupee
  • (HKD) Hong Kong Dollar
  • (CNY) Chinese Yuan
  • (BRL) Brazilian Real
  • (DKK) Danish Krone
  • (TWD) New Taiwan Dollar
  • (AUD) Australian Dollar
  • (NGN) Nigerian Naira
  • (SEK) Swedish Krona
  • (NOK) Norwegian Krone
  • (UAH) Ukrainian Hryvnia
  • (VND) Vietnamese Dong
Example:btc

Returns

Returns the converted value and the exchange rate.

statusstring

Status of the request. Should be success if the request didn't fail.

value_coinstring

Converted value for the selected currencies.

exchange_ratestring

The exchange rate between the two currencies.


Errors

  • You must provide a valid currency to convert to (HTTP 400): to is missing.
  • You must provide a valid currency to convert from (HTTP 400): from is missing.
  • You must provide a valid value and currency to convert from (HTTP 400): value is missing.
  • Value must be a decimal value (HTTP 400): value isn't a number.
  • Value out of range (HTTP 400): value is too large to convert.
  • Coin not supported (HTTP 400): we don't support from or to.

Every error has status set to error; check that field, not only the HTTP status code. Any endpoint can also answer Resource not found (404) or Server error (500): see Error Handling.