Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Yahoo stock search now with Google!

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignote Version 0.1.5 February 13, 2011
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 README.markdown Readme updated. October 12, 2013
Octocat-spinner-32 Rakefile
Octocat-spinner-32 ystock-0.4.5.gem
Octocat-spinner-32 ystock.gemspec
README.markdown

Ystock

This gem provides you with the latest market data avalable, pulling from both Google and Yahoo Finance.

Gem Version Build Status Code Climate

Install

Add the following to your Gemfile

gem "ystock", "~> 0.4.5"

# Or simply install it
gem install ystock -v=0.4.5

Bundle

bundle install

Sinatra or Ruby App

require 'ystock'

Google Usage

This uses the Google Finance API to request the latest market information (up to 15 min delay). The Google Finance API tends to return better and more useful information on the stock requested vs Yahoo.

Quote Usage

# Single Stock lookup {String}
Ystock::Google.quote("appl")

# Multiple Stock lookup {Array}
Ystock::Google.quote(["aapl", "f", "goog"])

Available data

symbol
pretty_symbol
symbol_lookup_url
company
exchange
exchange_timezone
exchange_utc_offset
exchange_closing
divisor
currency
last
high
low
volume
avg_volume
market_cap
open
y_close
change
perc_change
delay
trade_timestamp
trade_date_utc
trade_time_utc
current_date_utc
current_time_utc
symbol_url
chart_url
disclaimer_url
ecn_url
isld_last
isld_trade_date_utc
isld_trade_time_utc
brut_last
brut_trade_date_utc
brut_trade_time_utc
daylight_savings

Yahoo Usage

Quote Usage

# Single Stock lookup {String}
Ystock::Yahoo.quote("appl")

# Multiple Stock lookup {Array}
Ystock::Yahoo.quote(["aapl", "f", "goog"])

Available data

price
change
volume
symbol
change_percent
open
day_high
day_low

Tested with

This gem was tested with:

Ruby: 1.9.2 -> No longer supported.

Ruby: 1.9.3

Ruby: 2.0.0

Something went wrong with that request. Please try again.