Skip to content

xaviqo/exchangeapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About the project

API that fetches exchange-rates a publicly available API (https://exchangerate.host/) and uses them for conversion calculations

Run the application

  • Type in your terminal:

git clone https://github.com/xaviqo/exchangeapi.git
  • Launch the following command form the project root directory:

mvn spring-boot:run

Available endpoints

  • [GET] Get exchange rate from Currency A to Currency B:

/v1/exchange-rate/currency_a/currency_b

  • [GET] Get all exchange rates from Currency A:

/v1/all-rates/currency_a

  • [GET] Get value conversion from Currency A to Currency B:

/v1/value-conversion/currency_a/currency_b/amount

  • [POST] Get value conversion from Currency A to a list of supplied currencies:

/v1/multiple-values-conversion

Example payload:

{
"from":"EUR",
"amountTo":10,
"targetCurrencies":["GBP","HRK","MXN"]
}
  • [GET] Application health check:

/v1/health-check

Configurable parameters

In the application.properties file there are some parameters that can be adjusted

  • exchange-rate.host.time-out-sec: Threshold for external API response

  • exchange-rate.host.base: Base URL of the external API

  • exchange-rate.host.end-point.rates: Endpoint path to get the latest exchange rates

  • exchange-rate.host.end-point.symbols: Endpoint path to obtain the available currency codes

  • api.cfg.base-currency: ISO code of the currency that we will use for the conversion of values and for integration calls

  • api.cfg.cache.ttl-ms: Time to live in milliseconds of the cached data

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages