Elixir api client for Quandl.
The package can be installed by adding quandl
to your list of dependencies in mix.exs
:
def deps do
[
{:quandl, "~> 0.4.5"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/quandl.
Make sure Quandl API key is setup in your config file.
use MixConfig
config :quandl, api_key: "YOUR_API_KEY"
Alternatively, use environment variable QUANDL_API_KEY.
To fetch a time series of FB daily prices:
Quandl.V3.Api.Datasets.get_data("WIKI", "FB")
To get monthly % changes in Facebook closing price for the year 2014:
Quandl.V3.Api.Datasets.get_data(
"WIKI",
"FB",
column_index: 4,
start_date: "2014-01-01",
end_date: "2014-12-31",
collapse: "monthly",
transform: "rdiff"
)
To fetch metadata for the FB time series:
Quandl.V3.Api.Datasets.get_metadata("WIKI", "FB")
To fetch data and metadata for the FB time series, in one api call:
Quandl.V3.Api.Datasets.get_data_metadata("WIKI", "FB")
To fetch metadata for the WIKI database:
Quandl.V3.Api.Databases.get_metadata("WIKI")
To return columns ticker and date for the ETFG/FUND table.
Quandl.V3.Api.Datatables.get_data("ETFG/FUND", columns: "ticker,date")
To fetch metadata for table ETFG/FUND.
Quandl.V3.Api.Datatables.get_metadata("ETFG/FUND")