Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to lookup an index in Yahoo's stock API

I'm using Yahoo's stock API to get stock quotes, as described here.

Basically, I just assemble a link like this:

http://finance.yahoo.com/d/quotes.csv?s=DOW+MSFT+AAPL+GOOG&f=snl1

which'll give me a list of the current price for those stocks (DOW, MSFT, AAPL, GOOG).


All's nice and dandy, but I'd also like to get the info for the NASDAQ and S&P 500 Indices, but I have no idea what to use as the symbol for those.

I tried all of these:

NASDAQ

INDEXNASDAQ

INDEXNASDAQ:.IXIC

INDEXNASDAQ.IXIC

IXIC

to no avail.

It seems like I have the whole idea flawed (I don't really know much about finance).

Can anyone help me with this?

like image 900
MegaHit Avatar asked Feb 22 '23 07:02

MegaHit


1 Answers

Use the same symbols you see on the corresponding Yahoo finance page.

Nasdaq = ^IXIC

S&P = ^GSPC

Dow = ^DJI

like image 122
Dave Kasper Avatar answered May 22 '23 06:05

Dave Kasper