New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

equities

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

equities

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Equities

Equities is a simple Ruby library that retrieves a stock quote from Yahoo Finance (YQL).

Retrieve quotes for a single stock or multiple stocks (passed as an array) in one request. Results are returned converted to OpenStructs for easy access to specific values.

Installation

Add this line to your application's Gemfile:

gem 'equities'

And then execute:

$ bundle

Or install it yourself as:

$ gem install equities

Usage

Retrieve quote for a single stock

quote = Equities.quote 'aapl'
p quote.Name
# => "Apple Inc."

Retrieve quotes for multiple stocks

Provide an array of stock symbols to retrieve quotes for multiple stocks in a single request

quotes = Equities.quote ['aapl', 'goog']

Directly access an individual stock within the result set by it's symbol

p quotes['AAPL'].Name
# => "Apple Inc."

Or loop through the result set

quotes.each do |quote|
    p quote.last.Name
end
# => "Apple Inc."
# => "Google Inc."

Available Stock data

symbol
Ask
AverageDailyVolume
Bid
AskRealtime
BidRealtime
BookValue
Change_PercentChange
Change
Commission
Currency
ChangeRealtime
AfterHoursChangeRealtime
DividendShare
LastTradeDate
TradeDate
EarningsShare
ErrorIndicationreturnedforsymbolchangedinvalid
EPSEstimateCurrentYear
EPSEstimateNextYear
EPSEstimateNextQuarter
DaysLow
DaysHigh
YearLow
YearHigh
HoldingsGainPercent
AnnualizedGain
HoldingsGain
HoldingsGainPercentRealtime
HoldingsGainRealtime
MoreInfo
OrderBookRealtime
MarketCapitalization
MarketCapRealtime
EBITDA
ChangeFromYearLow
PercentChangeFromYearLow
LastTradeRealtimeWithTime
ChangePercentRealtime
ChangeFromYearHigh
PercebtChangeFromYearHigh
LastTradeWithTime
LastTradePriceOnly
HighLimit
LowLimit
DaysRange
DaysRangeRealtime
FiftydayMovingAverage
TwoHundreddayMovingAverage
ChangeFromTwoHundreddayMovingAverage
PercentChangeFromTwoHundreddayMovingAverage
ChangeFromFiftydayMovingAverage
PercentChangeFromFiftydayMovingAverage
Name
Notes
Open
PreviousClose
PricePaid
ChangeinPercent
PriceSales
PriceBook
ExDividendDate
PERatio
DividendPayDate
PERatioRealtime
PEGRatio
PriceEPSEstimateCurrentYear
PriceEPSEstimateNextYear
Symbol
SharesOwned
ShortRatio
LastTradeTime
TickerTrend
OneyrTargetPrice
Volume
HoldingsValue
HoldingsValueRealtime
YearRange
DaysValueChange
DaysValueChangeRealtime
StockExchange
DividendYield
PercentChange

Contributing

  1. Fork it ( https://github.com/JimMayes/equities/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

FAQs

Package last updated on 17 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc