yahoo_quote
Easy interaction with Yahoo Finance API
Installation
gem install yahoo_quote
Usage
require 'yahoo_quote'
quote = YahooQuote::Quote.new('AAPL', ['Name', 'Last Trade (Price Only)', 'P/E Ratio'])
quote.valid?
quote.data['Name']
quote.data['Last Trade (Price Only)']
quote.data['P/E Ratio']
quote = YahooQuote::Quote.new('ECOMMERCE', ['Name', 'Last Trade (Price Only)', 'P/E Ratio'])
quote.valid?
To get list of supported fields:
puts quote.field_mappings.keys
Configuration
Specify a directory to keep a simple file-based cache:
YahooQuote::Configuration.cache_dir = "/tmp"