Skip to content

thoran/eodhd.rb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. Fork it ( https://github.com/thoran/eodhd.rb/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new pull request

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages