Professional Documents
Culture Documents
1 of 6
http://www.marketindex.com.au/yahoo-finance-api
How to Import Share Price Data into Excel (with Yahoo! Finance)
Last Updated: 23 September 2015
Editor's Note: This software is non-commercial and for personal use only. No support is available.
Yahoo! and Google both unofficially provide a free way to download stock quotes using an API.
Yahoo! Finance
Financial data can be downloaded in a CSV, imported into an existing Excel Spreadsheet, or downloaded in XML / JSON
formatted data to display on a website using the Yahoo! Query Language (YQL) API.
Google Finance
Share price data can be imported into an existing Excel spreadsheet or downloaded in a JSON string for use on a website.
This article will cover two uses of the Yahoo! Finance API.
1. How to download Share Price Data in a CSV
2. How to Import Share Price Data into an Excel Spreadsheet
Disclaimer
Displaying share price data on a website (even delayed data) usually requires a license from
the relevant stock exchange/s.
The Google Finance API was officially deprecated in June 2011. It may cease to work at any
time.
The Yahoo Finance API is not officially supported and prone to glitches and inaccurate
data. Use for commercial reasons may result in a breach of Yahoo!s T&Cs.
As there are multiple exchanges around the world, you must specify which exchange your code relates to
by adding a suffix.
Australian listed companies require the suffix .AX to be added to the companies
11/12/2015 8:19 PM
2 of 6
http://www.marketindex.com.au/yahoo-finance-api
Most stock indices use a ^" prefix prior to the index code along with a country identifier.
The Australian All Ordinaries index has the prefix ^A (e.g. ^AORD).
The NASDAQ Composite uses the code ^IXIC.
To find the correct suffix for a company or prefix for an index, visit http://finance.yahoo.com and
start typing the name of the company into the Look Up box.
Yahoo! Tags
Company Details
Name
Stock Exchange
j1
Market Capitalisation
f6
Float Shares
b4
Book Value
Trading Data
Bid
a5
Ask Size
b6
Bid Size
d1
t1
l1
k3
c1
Change
p2
Change in Percent
Open
Day's High
Ask
11/12/2015 8:19 PM
3 of 6
http://www.marketindex.com.au/yahoo-finance-api
Day's Low
Day's Range
Volume
a2
Previous Close
Historical Performance
52-week Range
52-week High
52-week Low
k4
j5
k5
j6
Fundamental Analysis
Earnings/Share
j4
EBITDA
P/E Ratio
r5
PEG Ratio
Dividend/Share
Ex-Dividend Date
r1
Dividend Yield
t8
1 yr Target Price
Technical Analysis
m3
m4
m5
m6
finance industry.
m7
m8
Click to download
Yahoo! Share Price Spreadsheet (XLS)
You will get two warnings when you open the file:
1. The workbook contains Marcos (to process the data)
2. The workbook requires a data connection (to download data from the internet - duh!)
You must accept/enable both for the spreadsheet to work. The Macros are not password protected so you are free to view
and manipulate all code anyway you like.
11/12/2015 8:19 PM
4 of 6
http://www.marketindex.com.au/yahoo-finance-api
A few caveats:
Dow Jones data will not import due to licensing restrictions.
Financial data (e.g. dividends, ratios and target prices) are often only available for US listed
companies.
Most exchanges have a delay on their data of 10 - 30mins.
Youre limited to calling 200 codes at a time.
11/12/2015 8:19 PM
5 of 6
http://www.marketindex.com.au/yahoo-finance-api
specify in the Yahoo! Tag string. You will need to rename the column headers to match the order of the tags you specified in
C2.
Video Instructions
Related Links
Yahoo! Query Language
https://developer.yahoo.com/yql/
Yahoo Finance APIs
https://code.google.com/p/yahoo-finance-managed/wiki/YahooFinanceAPIs
How to import Yahoo stock data into a website
https://developer.yahoo.com/yql/console/
How to display a Yahoo stock chart on a web page
https://code.google.com/p/yahoo-finance-managed/wiki/miscapiImageDownload
How to pull stock quotes from Google Finance for a website
http://digitalpbk.com/stock/google-finance-get-stock-quote-realtime
ADVERTISE WITH US
Editor's Picks
Indices
Resources
ASX Analysis
11/12/2015 8:19 PM
6 of 6
http://www.marketindex.com.au/yahoo-finance-api
ASX 20
Homepage
Market Outlook
ASX 50
Trading Hours
Stock Tips
ASX 100
Index Methodology
Dividend Yield
ASX 200
Consensus Data
ASX 300
All Ordinaries
Follow Us
About Us
Advertise with Us
T&Cs
Privacy
Contact Us
MarketIndex.com.au and its data suppliers accept no responsibility for any claim, loss or damage as a result of information on this website.
All website content is provided "as is" and not for trading purposes. No information should be considered financial advice or used to make an investment decision.
Copyright 2015 Market Index. All rights reserved.
11/12/2015 8:19 PM