Historical stock data

Is there someplace I can download historical stock data in a machine-friendly format?

I want to test the following hypothesis: investing in 10 stocks chosen randomly from the S&P 500 Index has a similar return to the S&P 500 Index as a whole.

I'm interested in long-term effects, so one quote per stock per year would be sufficient. Some kind of server that I could programmatically query for the closing price of a ticker symbol on a certain date would be awesome.


11 comments to Historical stock data