Skip to content
forked from fixerAPI/fixer

A foreign exchange rates and currency conversion API

License

Notifications You must be signed in to change notification settings

AgenaTrader/fixer

 
 

Repository files navigation

Fixer 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 latest foreign exchange rates.

GET /latest

Get historical rates for any day since 1999.

GET /2000-01-03

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

Request specific exchange rates by setting the symbols parameter.

GET /latest?symbols=USD,GBP

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://your-domain/latest')
  .then((resp) => resp.json())
  .then((data) => fx.rates = data.rates)
  .then(demo)

Installation

I have included a sample Docker Compose configuration in the repo.

To build locally, type

docker-compose up -d

Now you can access the API at

http://localhost:8080

In production, create a .env file in the project root and run with

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

About

A foreign exchange rates and currency conversion API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 83.6%
  • Shell 15.6%
  • Dockerfile 0.8%