-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_batch_stock_quotes stopped working #184
Comments
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. |
* Removing get_batch_stock_quotes method Remove get_batch_stock_quotes method, resolving issue #184. * remove tests for get_batch_stock_quotes * Delete mock_batch_quotes Was only used for the tests removed in the previous commits, which made this file dead weight.
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. |
* Fixing pypi badge * Fixing typo on README * Use ==/!= to compare str, bytes, and int literals Identity is not the same thing as equality in Python so use ==/!= to compare str, bytes, and int literals. In Python >= 3.8, these instances will raise SyntaxWarnings so it is best to fix them now. https://docs.python.org/3.8/whatsnew/3.8.html#porting-to-python-3-8 $ python ``` >>> pandas = "panda" >>> pandas += "s" >>> pandas == "pandas" True >>> pandas is "pandas" False ``` * added rapidapi key integration * Fixing pypi badge * Fixing typo on README * Use ==/!= to compare str, bytes, and int literals Identity is not the same thing as equality in Python so use ==/!= to compare str, bytes, and int literals. In Python >= 3.8, these instances will raise SyntaxWarnings so it is best to fix them now. https://docs.python.org/3.8/whatsnew/3.8.html#porting-to-python-3-8 $ python ``` >>> pandas = "panda" >>> pandas += "s" >>> pandas == "pandas" True >>> pandas is "pandas" False ``` * added rapidapi key integration * prep for 2.1.3 * Removing get_batch_stock_quotes method (RomelTorres#189) * Removing get_batch_stock_quotes method Remove get_batch_stock_quotes method, resolving issue RomelTorres#184. * remove tests for get_batch_stock_quotes * Delete mock_batch_quotes Was only used for the tests removed in the previous commits, which made this file dead weight. * Add asyncio support for all components (RomelTorres#191) * Add asyncio support for all components In order to minimize the copy-paste between the async and sync implementations, all of the non-base components are sym-linked to their sync counterparts. Since these import `AlphaVantage` locally, they automatically pick up the async version, which is really nifty! There was some refactoring in `SectorPerformance` to make the re-use possible. The async verison of AlphaVantage tries to re-use as much as possible from the sync version. The main differences are: * a new `session` for the HTTP calls * a new `close()` function which should be called when you're done * `proxy` is a string instead of a dict Using it: ```python import asyncio from alpha_vantage.async_support.timeseries import TimeSeries async def get_data(): ts = TimeSeries(key='YOUR_API_KEY') data, meta_data = await ts.get_intraday('GOOGL') await ts.close() loop = asyncio.get_event_loop() loop.run_until_complete(get_data()) loop.close() ``` * Add asyncio packages to setup.py * Issue RomelTorres#206: Add 'time_period' argument to 'get_bbands()' documentation. (RomelTorres#207) * fixed fx documentation * fixed pypi badge for documentation * Fixes small documentation bugs (RomelTorres#208) * fixed fx documentation * fixed pypi badge for documentation * prep for 2.2.0 * small documentaiton change for 2.2.0 Co-authored-by: Igor Tavares <[email protected]> Co-authored-by: Christian Clauss <[email protected]> Co-authored-by: Aaron Sanders <[email protected]> Co-authored-by: Jon Cinque <[email protected]> Co-authored-by: Peter Anderson <[email protected]>
* added rapidapi key integration * prep for 2.1.3 * Removing get_batch_stock_quotes method (#189) * Removing get_batch_stock_quotes method Remove get_batch_stock_quotes method, resolving issue #184. * remove tests for get_batch_stock_quotes * Delete mock_batch_quotes Was only used for the tests removed in the previous commits, which made this file dead weight. * Add asyncio support for all components (#191) * Add asyncio support for all components In order to minimize the copy-paste between the async and sync implementations, all of the non-base components are sym-linked to their sync counterparts. Since these import `AlphaVantage` locally, they automatically pick up the async version, which is really nifty! There was some refactoring in `SectorPerformance` to make the re-use possible. The async verison of AlphaVantage tries to re-use as much as possible from the sync version. The main differences are: * a new `session` for the HTTP calls * a new `close()` function which should be called when you're done * `proxy` is a string instead of a dict Using it: ```python import asyncio from alpha_vantage.async_support.timeseries import TimeSeries async def get_data(): ts = TimeSeries(key='YOUR_API_KEY') data, meta_data = await ts.get_intraday('GOOGL') await ts.close() loop = asyncio.get_event_loop() loop.run_until_complete(get_data()) loop.close() ``` * Add asyncio packages to setup.py * Issue #206: Add 'time_period' argument to 'get_bbands()' documentation. (#207) * Fixes small documentation bugs (#208) * fixed fx documentation * fixed pypi badge for documentation * prep for 2.2.0 (#209) * fixed fx documentation * fixed pypi badge for documentation * prep for 2.2.0 * small documentaiton change for 2.2.0 Co-authored-by: Aaron Sanders <[email protected]> Co-authored-by: Jon Cinque <[email protected]> Co-authored-by: Peter Anderson <[email protected]>
* Prep for 2.1.3 (RomelTorres#178) * Fixing pypi badge * Fixing typo on README * Use ==/!= to compare str, bytes, and int literals Identity is not the same thing as equality in Python so use ==/!= to compare str, bytes, and int literals. In Python >= 3.8, these instances will raise SyntaxWarnings so it is best to fix them now. https://docs.python.org/3.8/whatsnew/3.8.html#porting-to-python-3-8 $ python ``` >>> pandas = "panda" >>> pandas += "s" >>> pandas == "pandas" True >>> pandas is "pandas" False ``` * added rapidapi key integration Co-authored-by: Igor Tavares <[email protected]> Co-authored-by: Christian Clauss <[email protected]> Co-authored-by: Patrick Collins <[email protected]> * Prep for 2.2.0 (RomelTorres#210) * added rapidapi key integration * prep for 2.1.3 * Removing get_batch_stock_quotes method (RomelTorres#189) * Removing get_batch_stock_quotes method Remove get_batch_stock_quotes method, resolving issue RomelTorres#184. * remove tests for get_batch_stock_quotes * Delete mock_batch_quotes Was only used for the tests removed in the previous commits, which made this file dead weight. * Add asyncio support for all components (RomelTorres#191) * Add asyncio support for all components In order to minimize the copy-paste between the async and sync implementations, all of the non-base components are sym-linked to their sync counterparts. Since these import `AlphaVantage` locally, they automatically pick up the async version, which is really nifty! There was some refactoring in `SectorPerformance` to make the re-use possible. The async verison of AlphaVantage tries to re-use as much as possible from the sync version. The main differences are: * a new `session` for the HTTP calls * a new `close()` function which should be called when you're done * `proxy` is a string instead of a dict Using it: ```python import asyncio from alpha_vantage.async_support.timeseries import TimeSeries async def get_data(): ts = TimeSeries(key='YOUR_API_KEY') data, meta_data = await ts.get_intraday('GOOGL') await ts.close() loop = asyncio.get_event_loop() loop.run_until_complete(get_data()) loop.close() ``` * Add asyncio packages to setup.py * Issue RomelTorres#206: Add 'time_period' argument to 'get_bbands()' documentation. (RomelTorres#207) * Fixes small documentation bugs (RomelTorres#208) * fixed fx documentation * fixed pypi badge for documentation * prep for 2.2.0 (RomelTorres#209) * fixed fx documentation * fixed pypi badge for documentation * prep for 2.2.0 * small documentaiton change for 2.2.0 Co-authored-by: Aaron Sanders <[email protected]> Co-authored-by: Jon Cinque <[email protected]> Co-authored-by: Peter Anderson <[email protected]>
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?
The text was updated successfully, but these errors were encountered: