Search code examples
excelyahooyahoo-financevba

Yahoo finance API and excel vba


I am building excel VBA program wherein it would fetch the result from yahoo finance api for more than 60K ticklers. as there are limitation of 200 tracing tickers at a time, there are few which returns blank as a result if I am trying to trace 200 tickers a time the resultant CSV file returns only 198 symbols result as it overrides the one which has blank entry because yahoo API does not returns anything for the few symbols.

Please see below query for the same.

http://download.finance.yahoo.com/d/quotes.csv?s=VPV+VPY.V+VQA.V+VQS.V+VQT+VR+VR.V+VR9F.EX+VRA+VRAP.PA+VRD+VRD.V+VRE.AX+VRE.TO+VRL.AX+VRML+VRNG+VRNGW+VRNL.PA+VRNM+VRNT+VRP.L+VRS+VRS.L+VRS.V+VRSK+VRSN+VRT.AX+VRTA+VRTB+VRTS+VRTU+VRTX+VRTX.MX+VRW.MI+VRW.V+VRX+VRX.AX+VRX.TO+VRZ.H.V+VRZ-H.V+VSAF.EX+VSAT+VSB+VSB.TO+VSBN+VSC.AX+VSC.TO+VSCI+VSCP+VSEC+VSH+VSI+VSI.V+VSMO.ME+VSN.DB.C.TO+VSN.PR.A.TO+VSN.TO+VSO.AX+VSP.TO+VSPY+VSR+VSR.V+VSS+VST.V+VSTM+VSTX.L+VSVS.L+VSXG.L+VSXX.L+VSYG.L+VT+VTA+VTA.AS+VTBR.IL+VTBR.L+VTC.L+VTG+VTG.AX+VTHR+VTI+VTI.V+VTIP+VTM.AX+VTM-H.V+VTMO.AX+VTN+VTN.TO+VTNC+VTNR+VTP.AX+VTR+VTR.TO+VTRB+VTS.AX+VTSF.EX+VTSS+VTU.L+VTUS+VTV+VTWG+VTWO+VTWV+VTX.AX+VUG+VUI.V+VUKE.L+VUL.V+VULC3.SA+VULC3F.SA+VUN.TO+VUS.TO+VUSA.L+VUSD.L+VV+VV.V+VVC+VVC.V+VVDG.EX+VVI+VVI.V+VVN.V+VVR+VVTV+VVUS+VVV.V+VWA.AS+VWM.AX+VWO+VWOB+VWRD.L+VWRL.L+VXF+VXIM.L+VXIS.L+VXR.AX+VXS.TO+VXSC.TO+VXUS+VXX+VXX.TO+VXX.U.TO+VXXKRB.AX+VXXKRD.AX+VXXKRE.AX+VXXKRG.AX+VXXKRP.AX+VXXKRR.AX+VXZ+VYC.V+VYFC+VYM+VZ+VZ.MX+VZC.L+VZN.SW+VZX.V+VZZ.V+W.PR.H.TO+W.PR.J.TO+W:707284.TWO+W:707285.TWO+W01.SI+W05.SI+W12.SI+W81.SI+WAA.AX+WAAO.AX+WAB+WABC+WAC+WAC.AX+WACO.AX+WAF.AX+WAFD+WAFDW+WAFM.L+WAG+WAGE+WAI.V+WAIR+WAL+WAL.AX+WALG.L+WALMEXV.MX+WAM.AX+WAN.V+WAND.L+WAPO.JK+WAR.L+WAR.V+WAS.AX+WAS.L+WAS.P.V+WASH+WASO.AX+WAT+WAT.AX+WAT.V+WATL.L&f=nl1d1hgkjx

Is there anyway we can have NULL kind of stuff as a return wherein it would return nothing ?

You can see in above querying URL it is trying to fetch the result for 200 symbols and it returns only 198 because two of them returns nothing and as a result the blank overrides with next rows which has data.


Solution

  • Well, I don't think the Yahoo Finance API works anymore. Take a look at the link below. I think 60k tickers may be pushing the limit, but basically, download the sample file from the link below and it should do what you want.

    http://investexcel.net/multiple-stock-quote-downloader-for-excel/

    enter image description here