-
This is a service integration to Exhange Rate API and exposes a RESTful endpoint. The endpoint accepts GET requests and returns a modified response schema from the integrated API.
-
The REST endpoint
/api/rates
returns a JSON object of the latest currency rates in the following format/schema:
{
"results": {
"base": "",
"date": "",
"rates": {
}
}
}
-
The
/api/rates
endpoint accepts the following request query parameter strings-
base: the home currency rates to be quoted against (e.g.
CZK
) -
currency: the specific exchange rates based on a comma-separated symbols parameter (e.g.
EUR,GBP,USD
).
-
-
Upon a successful API response, the fetched payload is an object containing the following keys:
- results: JSON object containing the results from the API
- base: the requested home rate from the request URL query strings
- date: the current date
- rates: An Object containing the requested currency in the request URL query strings
- As an example, a request to fetch the currency exchange rates from
CZK
toEUR,GBP,USD
might look like:
/api/rates?base=CZK¤cy=EUR,GBP,USD
- A successful response for the above request should return the following schema (of course with a more up-to-date values)
{
"results": {
"base": "CZK",
"date": "2020-11-17",
"rates": {
"EUR": 0.0377244605,
"GBP": 0.033795458,
"USD": 0.044824204
}
}
}