Go to file
Hakan Ensari a96e56808e Implement time series
... along with some minor miscellaneous refactoring

This finally completes fixerAPI/fixer#22
2018-07-05 21:30:17 +01:00
bin Refactor tasks that fetch rates 2018-06-08 15:32:52 +01:00
config Implement time series 2018-07-05 21:30:17 +01:00
db/migrate Repack app 2018-03-08 23:51:36 +00:00
lib Implement time series 2018-07-05 21:30:17 +01:00
spec Implement time series 2018-07-05 21:30:17 +01:00
.dockerignore Repack app 2018-03-08 23:51:36 +00:00
.env.example Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
.eslintrc Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
.gitignore Gardening 2017-12-31 16:35:03 +00:00
.rubocop.yml Implement time series 2018-07-05 21:30:17 +01:00
.tool-versions Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
.travis.yml Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
app.json Add a Heroku app.json 2018-06-08 15:32:52 +01:00
config.ru Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
docker-compose.override.yml Repack app 2018-03-08 23:51:36 +00:00
docker-compose.prod.yml Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
docker-compose.yml Move scheduler back to separate container 2018-01-08 12:12:54 +00:00
Dockerfile Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
Gemfile Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
Gemfile.lock Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
Guardfile Rebrand, serve HTML 2018-06-08 15:32:52 +01:00
LICENSE Remove dates from license 2017-01-03 12:44:13 +00:00
limit_req.conf Repack app 2018-03-08 23:51:36 +00:00
Rakefile Repack app 2018-03-08 23:51:36 +00:00
README.md Implement time series 2018-07-05 21:30:17 +01:00

Frankfurter

Travis

Frankfurter is a free API for current and historical foreign exchange rates published by the European Central Bank.

Rates are updated around 4PM CET every working day.

Usage

Get the current foreign exchange rates.

GET /current

Get historical rates for any day since 1999.

GET /2000-01-03

Rates quote against the Euro by default. Quote against a different currency.

GET /current?from=USD

Request specific exchange rates.

GET /current?to=GBP

Change the converted amount.

GET /current?amount=100

Finally, use all the above together.

GET /current?from=EUR&to=GBP&amount=100

The primary use case is client side. For instance, with money.js in the browser

let demo = () => {
  let rate = fx(1).from("GBP").to("USD")
  alert("£1 = $" + rate.toFixed(4))
}

fetch('https://yourdomain.com/current')
  .then((resp) => resp.json())
  .then((data) => fx.rates = data.rates)
  .then(demo)

Installation

To build locally, type

docker-compose up -d

Now you can access the API at

http://localhost:8080

In production, first create a .env file based on .env.example. Then, run with

docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

To update to a newer image

docker-compose -f docker-compose.yml -f docker-compose.prod.yml pull
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d

Within a few minutes, you will be able to access the API at

https://yourdomain.com:8080