Documentation
Migration Guide
This guide will help you migrate your application between CurrencyApi.net API versions.
Migrating from v1 to v2
Overview
- URL Updates: Change all endpoint URLs from
/api/v1/to/api/v2/ - Currency Changes: 24 currencies added and 10 currencies removed (152 to 166 total)
- Error Code Handling: Update error handling logic for updated HTTP status codes
- New Features: New OHLC endpoint
- Response Validation: Verify your code handles the updated currency list correctly
URL Changes
The most important change is updating all API endpoint URLs from v1 to v2:
-
/api/v1/rates→/api/v2/rates -
/api/v1/convert→/api/v2/convert -
/api/v1/history→/api/v2/history -
/api/v1/timeframe→/api/v2/timeframe -
/api/v1/currencies→/api/v2/currencies
Action Required: Search your codebase for all instances of /api/v1/ and replace them with /api/v2/.
Currency List Changes
Version 2 expands currency support from 152 to 166 currencies. The following changes were made:
Currencies Added (24 total)
- ADA (Cardano)
- BNB (Binance Coin)
- BYN (Belarusian Ruble)
- CLF (Chilean Unit of Account)
- DOGE (Dogecoin)
- DOT (Polkadot)
- ERN (Eritrean Nakfa)
- FKP (Falkland Islands Pound)
- GGP (Guernsey Pound)
- JEP (Jersey Pound)
- LINK (Chainlink)
- MGA (Malagasy Ariary)
- MNT (Mongolian Tögrög)
- MRO (Mauritanian Ouguiya)
- SHP (Saint Helena Pound)
- SOL (Solana)
- STN (São Tomé and Príncipe Dobra)
- SYP (Syrian Pound)
- USDC (USD Coin)
- USDT (Tether)
- VES (Venezuelan Bolívar)
- VUV (Vanuatu Vatu)
- XCG (Caribbean guilder)
- XPF (CFP Franc)
Currencies Removed (10 total)
- BCH (Bitcoin Cash)
- BTG (Bitcoin Gold)
- CNH (Chinese Yuan offshore)
- CUP (Cuban Peso)
- DASH (DASH)
- EOS (EOS)
- PGK (Papua New Guinean Kina)
- SBD (Solomon Islands Dollar)
- TOP (Tongan Paʻanga)
- XLM (Stellar Lumens)
Action Required: Update any hardcoded currency counts or validation logic that references 152 currencies. Remove validation for removed currencies and add support for new ones. See the currency list page for the complete list of supported currencies.
Error Code Changes
Updated HTTP Status Codes
Some error codes now return different HTTP status codes:
- 401: Now returns HTTP 401 (was HTTP 400 in v1)
- 417: Now returns HTTP 404 (was HTTP 400 in v1)
- 500: Now returns HTTP 500 (was HTTP 400 in v1)
New Error Codes
- 424: OHLC data is only available for the last 30 days. Returned when you request OHLC data for a date older than 30 days.
Action Required: Update your error handling code to account for these changes. For complete error code documentation, see the error codes page.
New Features
Version 2 introduces the new OHLC endpoint
- OHLC Endpoint (
/api/v2/ohlc): Get OHLC (Open, High, Low, Close) price data for technical analysis - Available on: Professional plan (Tier 3) only
- Use Cases: Trading charts, technical analysis, price pattern recognition
- Intervals: 5m, 15m, 30m, 1h, 4h, 12h, 1d
For complete documentation on the OHLC endpoint, including request parameters, response formats, and code examples, see the OHLC documentation.