Getting stock price history

Are there any simple HTTP APIs that will allow me to get the stock price for a character (e.g. GOOG) at a specific date and time?

Something like...

http://somewebsite.com/? symbol=GOOG& year=2010& month=7& day=30& hour=4& minute=00 

Giving an answer of $ 484.85

I hope to get the final result of the haskell function, whose type signature looks something like this ...

 getQuote :: Symbol -> Date -> Time -> Price 
+7
stocks
source share
4 answers

I believe that YQL with Yahoo finance can complete this task, they have data returning to 1996, looking at some stocks.

http://www.yqlblog.net/blog/2009/06/02/getting-stock-information-with-yql-and-open-data-tables/

http://www.gummy-stuff.org/Yahoo-data.htm

+11
source share

Here is an example on how to get JSON data from 2014-01-01 to 2015-01-01 for Apple (AAPL) through the Yahoo Finance API using YQL.

The YQL query is encoded at the URL:

 select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%3D%22AAPL%22%20and%20startDate%3D%222014-01-01%22%20and%20endDate%3D%222015-01-01%22 

So, if you decode it, you will get:

 select * from yahoo.finance.historicaldata where symbol="AAPL" and startDate="2014-01-01" and endDate="2015-01-01" 

Just change the date values ​​to the ones you need and decode it all, for example, using this URL encoder: http://meyerweb.com/eric/tools/dencoder/

Then combine all of this by adding an encoded request to the request URL:

 http://query.yahooapis.com/v1/public/yql?q={ENTER_QUERY_HERE}&env=http://datatables.org/alltables.env&format=json 

So you get something like this:

 http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%3D%22AAPL%22%20and%20startDate%3D%222014-01-01%22%20and%20endDate%3D%222015-01-01%22&env=http://datatables.org/alltables.env&format=json 

Which will return you some great JSON-formatted data for the specified time period.

+1
source share

Take a look at the historical securities data API at http://www.mergent.com/servius - I don't think they will have intraday data, though ...

0
source share

Historical intraday data can be found at http://www.myinvestorshub.com/historic_intraday_data.php (for all countries)

0
source share

All Articles