Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get minute bar historical data from Google finance?

I can get daily data easily using this link:

https://www.google.com/finance/getprices?q=LHA&x=ETR&i=60&p=1d&f=d,c,h,l,o,v

But when I try to change "1d" to "1y" I still get 1 day's data.

I am trying to get 2 years' worth.

Is there a way to do this? yahoo or bing finance would be fine too.

like image 853
ManInMoon Avatar asked Dec 17 '13 16:12

ManInMoon


2 Answers

You need to use '1Y', not '1y' on your query to get a time period stretching back 1 year. However, you will also need to change the granularity of your query, as minute data is only available for the previous 5 days.

This query will provide you with minute data for the previous 5 days.

https://www.google.com/finance/getprices?q=LHA&x=ETR&i=60&p=5d&f=d,c,h,l,o,v

The following query will provide you with the last two years of prices at the close.

https://www.google.com/finance/getprices?q=LHA&x=ETR&i=86400&p=2Y&f=d,c,h,l,o,v

like image 158
Conor Svensson Avatar answered Sep 28 '22 15:09

Conor Svensson


google API "getprices" is NO more fetching intraday data of any interval (say 1 minute or 5 minute or 60 minutes .....). It is now fetching data in 1 day interval only irrespective of interval set.

like image 21
R BHANJA Avatar answered Sep 28 '22 15:09

R BHANJA