Skip to main content

Convert Currency

Converts an amount from one currency to another using the current exchange rate.

Path Parameters

string
required
Currency code to convert from (e.g., “USD”)
string
required
Currency code to convert to (e.g., “EUR”)
float
required
Amount to convert (must be a positive number)

Exchange Rate Resolution

The API uses an intelligent exchange rate resolution system with three strategies:
  1. Direct Rate: First attempts to find a direct exchange rate from base to target currency
  2. Reverse Rate: If no direct rate exists, calculates using the reverse rate (1 / rate) from target to base
  3. Cross Rate: If neither direct nor reverse rate exists, calculates using cross rates through intermediate currencies (e.g., USD→RUB→EUR)

Response

object
Currency conversion result
object
Source currency information
integer
Currency ID
string
Currency code
string
Full currency name
string
Currency symbol
object
Target currency information (same structure as baseCurrency)
float
Exchange rate used for conversion
float
Original amount in base currency
float
Converted amount in target currency

Example Response

Example Usage

Convert USD to EUR:
Convert EUR to GBP:
Convert with decimal amount:

Conversion Logic

The conversion follows this formula:
For example:
  • Converting 100 USD to EUR with rate 0.92:
    • 100 × 0.92 = 92.0 EUR

Error Responses

Currency not found:
No exchange rate available:
Invalid amount format:

Multi-Currency Conversion Examples

Simple Direct Conversion

When a direct exchange rate exists between two currencies:
Response:

Reverse Rate Conversion

When only the reverse rate exists (e.g., EUR→USD exists, but you need USD→EUR):
The system automatically calculates the reverse rate.

Cross Rate Conversion

When no direct or reverse rate exists, the system uses intermediate currencies:
The system might convert GBP→USD→JPY automatically.

Notes

  • All amounts are returned as floating-point numbers
  • Exchange rates may be automatically created and saved when using reverse or cross rate strategies
  • The API ensures currency codes exist before performing conversions
  • Validation errors include descriptive messages (some in Russian)