Command line utility to extract data from https://openexchangerates.org/ API.
Note: You need to register an account to get an app_id from Open Exchange Rates. Some features are not available to free accounts, please see the Open Exchange Rates documentation for more details.
Download binaries directly from the releases page, or alternatively clone and build from source, see below for details.
TODO: Publish to homebrew etc...
oxr [flags]
oxr --help
oxr --version
--app_id
Your application ID from Open Exchange Rates API.
--job
Name of the job to run (latest|historical|timeseries).
--output
Path to the file you wish to write results to.
--dates
Date of historical exchange rates, can supply multiple dates (YYYY-MM-DD).
--start
Start date of time series query (YYYY-MM-DD).
--end
End date of time series query (YYYY-MM-DD).
--base
Currency to use as the base, defaults to USD
--fields
Define the list of fields to output in file (base,currency,rate,timestamp,date)
oxr --job latest --app_id YOUR_APP_ID --output PATH_TO_FILE
oxr --job latest --app_id YOUR_APP_ID --output PATH_TO_FILE --fields base,currency,rate
oxr --job historical --dates 2017-01-01 --app_id YOUR_APP_ID --output PATH_TO_FILE
oxr --job historical --dates 2017-01-01,2017-01-02 --app_id YOUR_APP_ID --output PATH_TO_FILE
oxr --job timeseries --start 2017-01-01 --end 2017-01-31 --app_id YOUR_APP_ID --output PATH_TO_FILE
To run or build from source clone the repo and run make build
this will also install the dependencies listed below.
The executables will be output to the ./dist
directory for darwin, linux and windows.
go get github.com/mvillalba/go-openexchangerates/oxr