RomelTorres/alpha_vantage

get_batch_stock_quotes stopped working

Closed this issue · 6 comments

Hi!

I was using get_batch_stock_quotes on regular basis and suddenly it stopped working (without updating av or any other python libraries). Calling the function for some list of stocks produces the error:

File ".../site-packages/alpha_vantage/alphavantage.py", line 292, in _handle_api_call
raise ValueError(json_response["Error Message"])
ValueError: This API function (BATCH_STOCK_QUOTES) does not exist.

I used simple code:
ts = TimeSeries(key='myPremiumKey',
output_format='pandas',
indexing_type='date')
ts.get_batch_stock_quotes(['AAPL','MSFT','AMZN','GOOG'])

Do you have any idea what might be a problem?

Thanks @cicavec, BATCH_STOCK_QUOTES has been depreciated for some time from the Alpha Vantage API, and looks like it was finally fully removed.

get_batch_stock_quotes should be a removed from this package.

Closing since the patch is currently in the develop branch, thanks @SandersAaronD!

Which function should one use instead? Thanks!

Hi @hydroo, you could run multiple API calls asynchronously or multithreaded instead. Take a look here for some more information on the multithreading approach: https://medium.com/alpha-vantage/data-is-taking-to-long-to-get-back-d48e3bf8f59b

and here for the async approach (currently in the develop branch): #191

@PatrickAlphaVantage I specifically used this API because of the 5 API calls per minute limit on the free plan. I just want to fetch a few prices a few times every few months. Nothing fancy.

So AlphaVantage is replacing a bulk query call with lots of single calls? That seems wasteful and counter-intuitive to me. Is there no alternative, except multi-threading?

At the moment, there is no bulk call replacement. It had been an undocumented and unsupported endpoint for quite some time, and only recently finally removed.