It is a simple and awesome way to get historical stock data programztically from Yahoo. That should get you started. If you want fundamental data ftp.sec.gov is free, but you will need to do a bit more work to extract the data. Let me know if you get anywhere, I'm looking for fundamental data too.