Looks like Yahoo Download API is now Dead - 11/1/2017

Discussion in 'Data Sets and Feeds' started by hayman, Nov 1, 2017.

  1. To use curl to download the export file it needs three things:

    1. A copy of the cookies that Yahoo uses. Best way is to install a fresh copy of Firefox Portable and add the Export Cookies add-on, then log into Yahoo. Then right click on the title bar, select Menu Bar then select Tools/Export Cookies from the menu bar and save as say cookies.txt

    2. The url that downloads the export file. In Firefox it can be copied with a right click on the 'Export' link and selecting Copy Link Location

    3. Installing curl and running it on the command line. Grab a copy from https://curl.haxx.se/, install, copy the cookies file into the same directory, open a command line and change to the the directory. Then run something like:

    curl "the-magic-url" --cookie cookies.txt --output yahooquotes.csv

    Hopefully that should do it! :)

    I guess Yahoo don't want to allow anonymous download as it makes it more open to abuse and denial of service attacks, even hacking.
    Last edited: Nov 4, 2017
    #51     Nov 4, 2017
    hayman and IceT like this.
  2. I've just produced a python script that can handle multi ticker yahoo data acquisition and thought I'd share incase this can help anyone. **The script requires the following packages which can be attained through pip: pandas / pandas_datareader / fix_yahoo_finance **

    The script saves each tickers data in a csv file in a folder named YahooData which is created in the same directory you place the python file. I have currently configured it to attain yahoo data for all S&P 500 companies but this can easily be modified to your own requirements by changing the list in line 42 such that it contains the tickers you require and finally comment out line 43.

    To run the script simply type "python AttainYahooData.py" in your command line ensuring that you are in the directory the python script is located.

    I've multi-threaded the process which speeds things up significantly.

    The data acquisition isn't always successful first time round so to retry type y when prompted by the command line. You may need to retry three or four times if you're downloading hundreds of tickers.

    The python script can be accessed on my google drive here:

    I have just modified the script so it will repeatedly try to fetch the tickers, without the need for user input, until tickers have been downloaded successfully. This will be better suited to automated systems based on yahoo data. Make sure you type the tickers correctly or else you will be stuck in a never ending loop :) (this version is named AttainYahooData_v1.py therefore use command "python AttainYahooData_v1.py" to run.

    Last edited: Nov 4, 2017
    #52     Nov 4, 2017
    d08, smileypete and hayman like this.
  3. nian


    and such programs:
    HSQuote / HSQuote Plus
    it is not sufficient?
    The creator of this HSQ is very polite and always helps with problems.
    #53     Nov 6, 2017
  4. Would you consider to create a modified script that creates a single csv file with one ticker data per line? Of course, if it is too much trouble, forget about it. I would do that myself but I don't have the skill needed.

    #54     Nov 10, 2017
  5. I can take a look into this when I have some spare time but could you please help me in understanding exactly what you require. Am I correct in thinking you want the script to fetch the most recent data available for a number of defined tickers and then compile it in a csv in the format below?

    ticker, open, low, high, close, adj close, volume
    A, xxx, xxx, xxx, xxx, xxx, xxx
    B, xxx, xxx, xxx, xxx, xxx, xxx

    If not could you give an example of what it is you want.
    #55     Nov 10, 2017
  6. barrett7


    I would definitely be interested in something like that.
    Ideally I would love to be able to pull Price, Dividend, and Upcoming Payment Date

    If this is something I could pull from a web query into excel automatically that would be great.
    I'm currently looking at https://iextrading.com/developer/docs/#iex-api to try and do this, but my knowledge is limited. I was using VBA code in excel to pull from Yahoo.
    #56     Nov 10, 2017
  7. Thank for your attention and for your answer.

    In the code box below you can see the actual content of the csv file I used to download from Yahoo every few minutes with Free Download Manager.

    This was the URL that created the csv from Yahoo:
    Then I have an auto updating query on external data in an Excel file that will get the data from the csv so every five minuts I can see the values updated.

    Now that Yahoo feature is dead, being able to recreate a similar csv in some other way would be awesome.


    #57     Nov 10, 2017
  8. To get the data into Excel I first created a "Query on external data" manually importing from the csv into a sheet named "tests2", then I went and see the query properties, gave it a name (in my case "PF13") and saved it and then I created a button on a sheet ("WEB" for me) that triggers this VBA sub routine:
    Private Sub UpdateButton_Click()
    Application.ScreenUpdating = False
        With Sheets("tests2")
              .QueryTables("PF13").Refresh BackgroundQuery:=True
        End With
    Application.ScreenUpdating = True
    End Sub
    Apart Yahoo errors every now and then, it's been working like a charm.


    #58     Nov 10, 2017
  9. #59     Nov 14, 2017
    inCom likes this.
  10. inCom


    #60     Nov 15, 2017