Project

yafa

0.0
No commit activity in last 3 years
No release in over 3 years
wrapper for yahoo finance stock quotes and chart data
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.13
~> 5.0
~> 10.0
~> 3.0
 Project Readme

Yafa

Yahoo Finance API wrapper, fetch stock quotes and stock chart data

Setup

Just install yafa or add it to your gemfile gem 'yafa'

Usage

Quotes data

Fetches the current/most recent stock quote:

tickers = ['GOOG']
fetcher = StockQuotes.new(tickers)
quotes  = fetcher.fetch

Tickers array takes up to 400 tickers at once

Chart data

Fetches per-minute quotes for the last day, good for making charts of recent stock prices

ticker = 'GOOG'
fetcher = StockChart.new(ticker)
chart_data = fetcher.fetch

Fetches for a single ticker per request

Historical Data

Coming soon...

Worth knowing

  • Yahoo Finance API sometimes goes down, so handle failed requests
  • Stay under your Yahoo API request limit, something like 20k/day (based on IP address making the request)

Improvements

  • Historical data api
  • Config for fetcher (i.e. timeouts, query params)
  • Option to replace Yahoo time and key formatting with a consistent format