Skip to content

API to fetch reference rates from European Central Bank

Notifications You must be signed in to change notification settings

andrelip/eur-exchange-rate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EurExchangeRate

CircleCI

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Setup Postgresql and set the environment variables PG_USER_NAME and PG_USER_PASSWORD
  • Create and migrate your database with mix ecto.create && mix ecto.migrate
  • Start Phoenix endpoint with mix phx.server
  • To update the ratings run mix fetch_ratings in your favorite cron-like runner

Endpoints

Now you can visit from your browser:

  • localhost:4000/rates/latest

    List the latest ratings

    {
      "rates": {
      "ZAR": "16.9754",
      "USD": "1.1506",
      "TRY": "7.0963",
      ...
    }
    
  • localhost:4000/rates/YYYY-MM-DD

    List the ratings for a given date

    {
      "rates": {
      "ZAR": "16.9754",
      "USD": "1.1506",
      "TRY": "7.0963",
      ...
    }
    
  • localhost:4000/rates/analyze

    Analyze the currencies for a time span of 90 days

    {
      "rates_analyze": {
      "ZAR": {
      "min": "17.01",
      "max": "17.9906",
      "avg": "16.41912615384615384615384615"
      },
      "USD": {
      "min": "1.137",
      "max": "1.1789",
      "avg": "1.161864615384615384615384615"
      },
      ...
    }
    

About

API to fetch reference rates from European Central Bank

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published