This tutorial shows how to convert currencies with the ForexRateAPI free plan. For a complete summary of live rates, historical data, hourly observations, and OHLC, start with the Forex API product overview. When you are ready to follow the examples below, create a free API key.
Choose from 150+ supported currencies. Review or download the supported currency-code list.
Popular options include the US dollar, euro, pound sterling, yen, yuan, rupee, peso, won, franc, and baht.
The conversion endpoint supports current and historical conversions. See the conversion endpoint reference for its parameters and response format.
Below is an example usage for historical foreign exchange conversion API in use
https://api.forexrateapi.com/v1/convert?api_key=[API_KEY]&from=USD&to=EUR&amount=100&date=2022-01-30
https://api.forexrateapi.com/v1/convert?api_key=[API_KEY]&from=USD&to=EUR&amount=100
https://api.forexrateapi.com/v1/convert?api_key=[API_KEY]&from=USD&to=JPY&amount=100
https://api.forexrateapi.com/v1/convert?api_key=[API_KEY]&from=USD&to=CAD&amount=100
https://api.forexrateapi.com/v1/convert?api_key=[API_KEY]&from=USD&to=SGD&amount=100
Create a free key, copy one example, and replace the currencies and amount with your own values. For client libraries, visit the ForexRateAPI GitHub organization.