Convert Currency
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:- Direct Rate: First attempts to find a direct exchange rate from base to target currency
- Reverse Rate: If no direct rate exists, calculates using the reverse rate (1 / rate) from target to base
- 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
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:Conversion Logic
The conversion follows this formula:- Converting 100 USD to EUR with rate 0.92:
100 × 0.92 = 92.0 EUR
Error Responses
Currency not found:Multi-Currency Conversion Examples
Simple Direct Conversion
When a direct exchange rate exists between two currencies:Reverse Rate Conversion
When only the reverse rate exists (e.g., EUR→USD exists, but you need USD→EUR):Cross Rate Conversion
When no direct or reverse rate exists, the system uses intermediate currencies: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)