mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-21 18:42:29 +01:00
07781b6d76
Warming up -------------------------------------- json 16.465k i/100ms yajl 18.574k i/100ms oj 34.073k i/100ms Calculating ------------------------------------- json 182.828k (± 7.8%) i/s - 922.040k in 5.075699s yajl 196.839k (± 4.5%) i/s - 984.422k in 5.011087s oj 384.813k (± 5.9%) i/s - 1.942M in 5.065475s Comparison: oj: 384813.2 i/s yajl: 196839.0 i/s - 1.95x slower json: 182827.5 i/s - 2.10x slower |
||
---|---|---|
config | ||
db/migrate | ||
deploy | ||
lib | ||
public | ||
spec | ||
.gitignore | ||
.pryrc | ||
.rubocop.yml | ||
.ruby-gemset | ||
.ruby-version | ||
.travis.yml | ||
config.ru | ||
docker-compose.yml | ||
Dockerfile | ||
Gemfile | ||
Gemfile.lock | ||
LICENSE | ||
Procfile | ||
Rakefile | ||
README.md | ||
wait-for-it.sh |
Fixer.io
Fixer.io is a free JSON API for current and historical foreign exchange rates published by the European Central Bank.
The rates are updated daily around 3PM CET.
Usage
Get the latest foreign exchange reference rates in JSON format.
GET /latest
Host: api.fixer.io
Get historical rates for any day since 1999.
GET /2000-01-03
Host: api.fixer.io
Rates are quoted against the Euro by default. Quote against a different currency by setting the base parameter in your request.
GET /latest?base=USD
Host: api.fixer.io
Request specific exchange rates by setting the symbols or currencies parameter.
GET /latest?symbols=USD,GBP
Host: api.fixer.io
Make cross-domain JSONP requests.
GET /latest?callback=?
Host: api.fixer.io
An HTTPS endpoint is also available at https://api.fixer.io.
Use money.js in the browser.
var demo = function(data) {
fx.rates = data.rates
var rate = fx(1).from("GBP").to("USD")
alert("£1 = $" + rate.toFixed(4))
}
$.getJSON("http://api.fixer.io/latest", demo)
Docker
You can run a local instance of the app using Docker.
Bring the stack up.
docker-compose up -d
Initialize the database and seed data.
docker-compose run web rake db:migrate rates:load
docker-compose restart web