source: project/wiki/eggref/4/yahoo-finance @ 36453

Last change on this file since 36453 was 36453, checked in by evhan, 13 months ago

eggref/4: Mark some old eggs as obsolete

File size: 2.5 KB
Line 
1[[tags: egg]]
2
3== yahoo-finance
4
5[[toc:]]
6
7=== Description
8
9This was a tiny library for accessing Yahoo Finance's stock data "API".
10
11It is now obsolete, since Yahoo has done away with the APIs it used.
12
13'''Don't use it, it won't work.'''
14
15=== Requirements
16
17* [[/egg/csv-xml|csv-xml]]
18* [[/egg/uri-common|uri-common]]
19* [[/egg/intarweb|intarweb]]
20* [[/egg/http-client|http-client]]
21
22=== API
23
24There are two functions.
25
26<procedure>(fetch-quotes symbol-or-symbols field-or-fields)</procedure>
27
28{{fetch-quotes}} takes one or more stock symbols and one or more field name
29symbols and returns a table of the requested information:
30
31    > (use yahoo-finance)
32   
33    > (fetch-quotes 'aapl 'eps)
34    ((stock (eps 42.548)))
35   
36    > (fetch-quotes 'aapl '(name p/e p/s p/b))
37    ((stock (name "Apple Inc.")
38            (p/e 15.86)
39            (p/s 4.25)
40            (p/b 5.66)))
41   
42    > (fetch-quotes '(aapl goog msft) '(name high low change)))
43    ((stock (name "Apple Inc.")
44            (high 677.67)
45            (low 672.6)
46            (change -1.334))
47     (stock (name "Google Inc.")
48            (high 688.99)
49            (low 676.15)
50            (change 10.76))
51     (stock (name "Microsoft Corpora")
52            (high 30.75)
53            (low 30.44)
54            (change 0.02)))
55
56Read the code for a list of available fields.
57
58<procedure>(fetch-quotes symbol [interval [start-date [end-date]]])</procedure>
59
60{{fetch-history}} takes a single stock symbol and, as optional arguments, an
61interval symbol (one of {{daily}}, {{weekly}}, {{monthly}}, or {{dividends}}),
62a start date as a list of numbers of the form {{(y m d)}}, and an end date of
63the same form. It returns a table in one of two forms:
64
65    > (fetch-history 'aapl 'monthly)
66    ((row (date "2012-08-01")
67          (open 615.91)
68          (high 680.87)
69          (low 600.25)
70          (close 673.47)
71          (volume 13327800)
72          (adjusted-close 673.47))
73     (row (date "2012-07-02")
74          (open 584.73)
75          (high 619.87)
76          (low 570.0)
77          (close 610.76)
78          (volume 15938700)
79          (adjusted-close 608.15))
80      ...)
81   
82    > (fetch-history 'aapl 'dividends '(1987 1 1) '(1989 1 1))
83    ((row (date "1988-11-21") (dividend 0.025))
84     (row (date "1988-08-15") (dividend 0.02))
85     (row (date "1988-05-16") (dividend 0.02))
86     (row (date "1988-02-12") (dividend 0.02))
87     (row (date "1987-11-17") (dividend 0.02))
88     (row (date "1987-08-10") (dividend 0.015))
89     (row (date "1987-05-11") (dividend 0.015)))
90
91=== License
92
93Public Domain
Note: See TracBrowser for help on using the repository browser.