Skip to content
pnathan edited this page Mar 9, 2013 · 13 revisions

cl-yahoo-finance

cl-yahoo-finance provides a thin layer over the Yahoo Finance endpoint.

The current version is 4.0. Any modifications to the existing API will cause a version bump. Any bugfixes will induce a minor revision bump. cl-yahoo-finance is available in the January 2012 (and beyond) Quicklisp distribution.

News contains the current news and upcoming changes.

Example (from USAGE.lisp)

;; Load me up
(ql:quickload :cl-yahoo-finance)

;; Pull in the complete details for the big G and big Blue
(cl-yahoo-finance:read-current-data '("GOOG" "IBM"))

;; Get the historical data from TSLA
(cl-yahoo-finance:read-historical-data "TSLA" '(1 1 2011) '(6 1 2011))

Manual

WITH-PROXY proxy &body body

Macro

Sets the HTTP proxy to be proxy for the duration of the body.

PROXY

Special variable

Value of the HTTP proxy to be used

READ-CURRENT-DATA

Syntax: READ-CURRENT-DATA list-of-symbols|symbol &key proxy

READ-CURRENT-DATA reads the "most recent" series of datapoints for symbol(s) and returns a list of HASH-TABLEs containing the string keys mapping to the data.

READ-CURRENT-COMPANY-INFO

Syntax READ-CURRENT-COMPANY-INFO list-of-symbols|symbol &key proxy

READ-CURRENT-COMPANY-INFO reads a list of properties of the company and returns a list of HASH-TABLEs containing keys mapping to information.

READ-HISTORICAL-DATA

Syntax: READ-HISTORICAL-DATA symbol start-date-triple end-date-triple &key (historical-type 'daily) proxy

READ-HISTORICAL-DATA reads the historical data for symbol(s) and returns a list of hash tables with keys Date, Open, High, Low, Close, Volume, Adj-Close for all days within the range.

start-date-triple and end-date-triple are three-element lists of month/day/year integers

READ-HISTORICAL-SPLITS

Syntax: READ-HISTORICAL-SPLITS symbol start-date-triple end-date-triple &key proxy READ-HISTORICAL-SPLITS reads the historical data for symbol(s) and returns a list of hash tables with keys DATE RATIO.

start-date-triple and end-date-triple are three-element lists of month day year integers

Caveats

cl-yahoo-finance is subject to the same availabilities and delays as Yahoo itself.

It requires a number of libraries, all available through Quicklisp

Changelog

v4.0

  • Regularized API
  • Cleaned up proxy info.

v3.0

  • Added proxy support with WITH-PROXY
  • Added READ-CURRENT-COMPANY-INFO
  • Changed READ-HISTORICAL-DATA to use keyword args instead of optional.

v2.0

  • read-historical-data was added by Chris Howey. Thanks, Chris!

v1.1

  • Available on Quicklisp. Thanks, Zach!