Yahoo Finance Historical data downloader url is not working

后端 未结 7 1200
野的像风
野的像风 2020-12-01 13:09

I have used the following url to fetch the historical data from yahoo finance. From last 16th May, 2017 the url is not working.

http://real-chart.finance.yahoo.com/t

7条回答
  •  天命终不由人
    2020-12-01 14:05

    Got it to work, now I just have to parse the csv. Thought I'd share since I was having trouble with the syntax.

    Dim crumb As String:    crumb = "xxxx"
    Dim cookie As String:   cookie = "yyyy"
    
    Dim urlStock As String: urlStock = "https://query1.finance.yahoo.com/v7/finance/download/SIRI?" & _
        "period1=1274158800&" & _
        "period2=1495059477&" & _
        "interval=1d&events=history&crumb=" & crumb
    
    Dim http As MSXML2.XMLHTTP:   Set http = New MSXML2.ServerXMLHTTP
    http.Open "GET", urlStock, False
    http.setRequestHeader "Cookie", cookie
    http.send
    

提交回复
热议问题