A simple Exchange Rates API
Data is collected once a day from Open Exchange Rates
- Getting up-to-date data
- Getting rates by date
- Getting rates by period (2 routes)
- Filtering by currency code
{date}
- Date in formatYYYY-MM-DD
{period}
- Date in formatYYYY-MM-DD
orYYYY-MM
orYYYY
{symbols}
- Сomma-separated list of currencies (Example: usd,eur,cny)
/currencies
Description: Get list of available currencies
Method: GET
/date/{date}
Description: Get exchange rate for a specific date
Method: GET
Optional params: symbols={symbols}
/date/last
Description: Get exchange rate for a last day
Method: GET
Optional params: symbols={symbols}
/period/simple/{period}
Description: Get list of rates for a certain period
Method: GET
Optional params: symbols={symbols}
/period/advanced
Description: Get list of rates for a certain period
Method: GET
Required params: from={period}, to={period}
Optional params: symbols={symbols}
/update_rates
Description: Update exchange rates (only localhost)
Method: POST
- http://localhost:3000/currencies
- http://localhost:3000/date/2022-08-30
- http://localhost:3000/last?symbols=eur,usd
- http://localhost:3000/period/simple/2022-08?symbols=eur,usd
- http://localhost:3000/period/advanced?from=2022-08&to=2022-09
- Create
docker-compose.yml
with content:
version: "3.8"
services:
exrates-api:
image: idefant/exrates-api
container_name: exrates-api
env_file:
- .env
restart: unless-stopped
ports:
- "8182:3000"
- Create
.env
and fill in similarly.env.sample
- Run
docker compose up -d
To begin development:
- Clone this repo
- Create
.env
and fill in similarly.env.sample
npm i
npm run build
npm run dev