How to Access Yahoo Finance YQL query with historical data

后端 未结 3 1751
北海茫月
北海茫月 2020-12-13 11:18

I\'m new to YQL. Perhaps this is very trivial, but I couldn\'t quite figure this out. I know, for instance, how to query current stock data from Yahoo/YQL using the YQL cons

相关标签:
3条回答
  • 2020-12-13 11:48

    You're using the wrong table.

    select * from yahoo.finance.historicaldata where symbol = "YHOO" and startDate = "2009-09-11" and endDate = "2010-03-10"
    

    Alternatively, you could use stockretriever.py for this. In the source code, you can find a workaround for historical data.

    0 讨论(0)
  • 2020-12-13 11:56

    The table is correct. You need to append the store parameter in your query string. Here is the sample string.

    http://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.historicaldata where symbol = "YHOO" and startDate = "2014-02-11" and endDate = "2014-02-18"&diagnostics=true&env=store://datatables.org/alltableswithkeys
    

    Hope it helps you.

    0 讨论(0)
  • 2020-12-13 11:59

    yahoo.finance.historicaldata is working, but you have to use startDate and endDate:

    select * from yahoo.finance.historicaldata where symbol in ("YHOO","AAPL","GOOG","MSFT") and startDate = "2012-09-13" and endDate = "2012-09-13"
    
    0 讨论(0)
提交回复
热议问题