Reputation: 525
I am trying to pull over end-of-day share prices going back in time. The code below provides exactly what I need but it appears that that the year/month/day parameters do not work.
import requests
params={'q': 'NASDAQ:AAPL', 'expd': 10, 'expm': 3, 'expy': 2018, 'output': 'json'}
response = requests.get('https://finance.google.com/finance', params=params, allow_redirects=False, timeout=10.0)
print(response.content)
The closing price for this is "l" : "178.65"
which is the most recent closing price (15 March) and not for 10 March as specified. I am assuming I cannot rely on this service as it is no longer supported by Google but would be good if someone can confirm if I am correct around the dates not working or if I am missing something.
Upvotes: 4
Views: 752
Reputation: 5266
Well, up until this morning this used to work:
I asked two other people to confirm on different ISPs and we all get the same error message:
We're sorry... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now. See Google Help for more information.
Upvotes: 1
Reputation: 1493
This URL still works:
I recommend you to make a copy of the data ASAP though, because Google will probably close this other link soon.
Upvotes: 1
Reputation: 11
same here: https://finance.google.com/finance/historical?q=AAPL&output=csv
it looks like google close finance api or change path.
Upvotes: 1