eodhd.rb
Description
Access the eodhd.com API with Ruby.
Installation
Add this line to your application's Gemfile:
gem 'eodhd.rb'
And then execute:
$ bundle
Or install it yourself as:
$ gem install eodhd.rb
Usage
Setup
api_token = 'api_token'
eodhd_api ||= Eodhd.new(api_token: api_token)
List of Exchanges
eodhd_api.exchanges
List of Exchange Symbols
exchange = eodhd_api.exchanges.first
eod_api.exchange_symbols(exchange: exchange)
# OR
eod_api.exchange_symbols(exchange_code: exchange.code)
Retrieve EOD Data For One Symbol
exchange = eodhd_api.exchanges.first
exchange_symbol = eod_api.exchange_symbols(exchange: exchange).first
eod_api.eod_data(exchange: exchange, exchange_symbol: exchange_symbol)
# OR
eod_api.eod_data(exchange_code: exchange.code, exchange_symbol: exchange_symbol)
# OR
eod_api.eod_data(exchange: exchange, symbol: exchange_symbol.code)
# OR
eod_api.eod_data(exchange_code: exchange.code, symbol: exchange_symbol.code)
Retrieve EOD Data For Multiple Symbols For One Date
exchange = eodhd_api.exchanges.first
eod_api.eod_bulk_last_day(exchange: exchange, date: Date.today)
# OR
eod_api.eod_bulk_last_day(exchange_code: exchange.code, date: Date.today)
Contributing
- Fork it ( https://github.com/thoran/eodhd.rb/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new pull request