Home > finance > Download financial data using the Yahoo API

Download financial data using the Yahoo API

Problem

If you want to consult financial information, Yahoo! Finance is a good site for that. For instance, to get info about Microsoft’s shares, just visit http://finance.yahoo.com/q?s=msft&ql=1. There, in the bottom right corner in the Toolbox section, you can find a link “Download Data”.

But is there another way to get financial data? Is there a Yahoo API for this?

Solution

The answer to the previous question is: yes, there is. Visit http://www.gummy-stuff.org/Yahoo-data.htm for a detailed presentation of the API.

Example:


http://finance.yahoo.com/d/quotes.csv?s=MSFT&f=nl1px

Here we ask stock information about the shares of Microsoft. Their stock code is “MSFT”. We pass four parameters: n – stock name, l1 – current price, p – price at the previous close, x – stock exchange. The data is returned as a text file in .csv format:

"Microsoft Corpora",27.245,27.34,"NasdaqNM"

Special tags:

At http://www.gummy-stuff.org/Yahoo-data.htm, you can find a table with all the special tags. I collected them here, in a single link: copy link (see the link in the status bar).

This can help you to choose the parameters that you really need.

About these ads
Categories: finance Tags: , , , ,
  1. sylvain
    February 8, 2011 at 17:36

    I am looking for special code on yahoo to extract CBOT commodity, ie soybean, corn…
    Thanks

  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 72 other followers

%d bloggers like this: