converting daily stock data to weekly-based via pandas in Python

You can resample (to weekly), offset (shift), and apply aggregation rules as follows: logic = {‘Open’ : ‘first’, ‘High’ : ‘max’, ‘Low’ : ‘min’, ‘Close’ : ‘last’, ‘Volume’: ‘sum’} offset = pd.offsets.timedelta(days=-6) f = pd.read_clipboard(parse_dates=[‘Date’], index_col=[‘Date’]) f.resample(‘W’, loffset=offset).apply(logic) to get: Open High Low Close Volume Date 2010-01-04 38.660000 40.700001 38.509998 40.290001 5925600 2010-01-11 40.209999 40.970001 … Read more

Yahoo finance webservice API

I don’t know where the definitive documentation might be but for your particular example try appending &view=detail to your URL. http://finance.yahoo.com/webservice/v1/symbols/COALINDIA.NS/quote?format=json&view=detail This will at least give you the year_high and year_low that you asked after. Now, even though the following won’t work for your COALINDIA.NS symbol (I suspect the exchange is not supported), it might … Read more

Has Yahoo suddenly today terminated its finance download API?

As noted in the other answers and elsewhere (e.g. https://stackoverflow.com/questions/47076404/currency-helper-of-yahoo-sorry-unable-to-process-request-at-this-time-erro/47096766#47096766), Yahoo has indeed ceased operation of the Yahoo Finance API. However, as a workaround, you can access a trove of financial information, in JSON format, for a given ticker symbol, by doing a HTTPS GET request to: https://finance.yahoo.com/quote/SYMBOL (e.g. https://finance.yahoo.com/quote/MSFT). If you do a GET … Read more

Has Yahoo finance web service disappeared? API changed? Down temporarily?

I was facing a similar issue from last 2-3 days. The url works on the smartphone, where on the desktop it gives “Not a valid parameter” error and HTTP Code 406. This can be resolved by adding user agent as “Mozilla/5.0 (Linux; Android 6.0.1; MotoG3 Build/MPI24.107-55) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537.36” while invoking … Read more

Yahoo Finance API [closed]

IMHO the best place to find this information is: http://code.google.com/p/yahoo-finance-managed/ I used to use the “gummy-stuff” too but then I found this page which is far more organized and full of easy to use examples. I am using it now to get the data in CSV files and use the files in my C++/Qt project.

“TypeError: string indices must be integers” when getting data of a stock from Yahoo Finance using Pandas Datareader

None of the solutions reported here so far worked for me. As per the discussion here Yahoo made changes to their API that broke compatibility with previous pandas datareader versions. In the same Github thread a fix is reported, implemented in a pull request from Github user raphi6. I confirmed the pull request works fine. … Read more

tech