0

I have had this code run before, and Google Finance used to give me the Dividend and Yield in the dictionary it returns. How do I get that data now that it won't come in this dictionary?

from googlefinance import getQuotes
import json

print(json.dumps(getQuotes('D'), indent=2))

Which Used to Return:

[
   {
     "ID": "10020",
     "StockSymbol": "D",
     "Index": "NYSE",
     "LastTradePrice": "77.96",
     "LastTradeWithCurrency": "77.96",
     "LastTradeTime": "4:01PM EDT",
     "LastTradeDateTime": "2017-08-08T16:01:05Z",
     "LastTradeDateTimeLong": "Aug 8, 4:01PM EDT",
     "Dividend": "0.75",
     "Yield": "3.87"
   }
 ]

And now only returns:

 [
  {
     "ID": "10020",
     "StockSymbol": "D",
     "Index": "NYSE",
     "LastTradePrice": "77.96",
     "LastTradeWithCurrency": "77.96",
     "LastTradeTime": "4:01PM EDT",
     "LastTradeDateTime": "2017-08-08T16:01:05Z",
     "LastTradeDateTimeLong": "Aug 8, 4:01PM EDT",
   }
 ]
  • That is the downside of using external resources - their data can change whenever they want. Furthermore, they must've just been updating the information as your exact code displays the `Dividend` – Wondercricket Sep 01 '17 at 20:17
  • so what are you suggesting? is there a direct API to work with ? – Evyatar Sivan Jan 17 '18 at 16:20

0 Answers0