pepusz / yahoo-finance Goto Github PK
View Code? Open in Web Editor NEWThis project forked from herval/yahoo-finance
A dead simple wrapper for yahoo finance quotes end-point.
This project forked from herval/yahoo-finance
A dead simple wrapper for yahoo finance quotes end-point.
Ruby's Yahoo Finance Wrapper ============================ A dead simple wrapper for yahoo finance quotes end-point. Usage: 1 - Getting latest quotes for a set of symbols ---------------------------------------------- Just pass an array of symbols (stock names, indexes, exchange rates) and a list of fields you want: data = YahooFinance.quotes(["BVSP", "NATU3.SA", "USDJPY=X"], [:ask, :bid, :last_trade_date]) # ask will be a string here: puts data[0].symbol + " value is: " + data[0].ask Or optionally: data = YahooFinance.quotes(["BVSP", "NATU3.SA", "USDJPY=X"], [:ask, :bid, :last_trade_date], { :raw => false } ) # ask will be a float here: puts data[0].symbol + " value is: " + data[0].ask The full list of fields follows: :ask :average_daily_volume :ask_size :bid :ask_real_time :bid_real_time :book_value b4 :bid_size b6 :chance_and_percent_change :change :comission :change_real_time :after_hours_change_real_time :dividend_per_share :last_trade_date :trade_date :earnings_per_share :error_indicator :eps_estimate_current_year :eps_estimate_next_year :eps_estimate_next_quarter :float_shares :low :high :low_52_weeks :high_52_weeks :holdings_gain_percent :annualized_gain :holdings_gain :holdings_gain_percent_realtime :holdings_gain_realtime :more_info :order_book :market_capitalization :market_cap_realtime :ebitda :change_From_52_week_low :percent_change_from_52_week_low :last_trade_realtime_withtime :change_percent_realtime :last_trade_size :change_from_52_week_high :percent_change_from_52_week_high :last_trade_with_time :last_trade_price :close :high_limit :low_limit :days_range :days_range_realtime :moving_average_50_day :moving_average_200_day :change_from_200_day_moving_average :percent_change_from_200_day_moving_average :change_from_50_day_moving_average :percent_change_from_50_day_moving_average :name :notes :open :previous_close :price_paid :change_in_percent :price_per_sales :price_per_book :ex_dividend_date :pe_ratio :dividend_pay_date :pe_ratio_realtime :peg_ratio :price_eps_estimate_current_year :price_eps_Estimate_next_year :symbol :shares_owned :short_ratio :last_trade_time :trade_links :ticker_trend :one_year_target_price :volume :holdings_value :holdings_value_realtime :weeks_range_52 :day_value_change :day_value_change_realtime :stock_exchange :dividend_yield 2 - Getting historical quotes ----------------------------- Here you can specify a date range and a symbol, and retrieve historical data for it. The last parameter (options) can include, besides the "raw" option, a "period" option. The period can be specified as :daily, :monthly, :weekly or :dividends_only data = YahooFinance.historical_quotes("BVSP", Time::now-(24*60*60*10), Time::now) # 10 days worth of data or data = YahooFinance.historical_quotes("BVSP", Time::now-(24*60*60*10), Time::now, { :raw => false, :period => :monthly }) Enjoy! :-) - Herval ([email protected])
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.