Giter Site home page Giter Site logo

fixer's Introduction

Fixer

Travis

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

A public instance of the API lives at https://api.fixer.io. Alternatively, you can run privately with the provided Docker image.

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://api.fixer.io/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

fixer's People

Contributors

hakanensari avatar madwork avatar 0x46616c6b avatar ezkl avatar nilsding avatar tomtasche avatar

Watchers

Stoica Márk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.