Skip to content
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_price() results in error: version 0.4.2 #159

Closed
john8988 opened this issue Jun 20, 2019 · 8 comments
Closed

get_price() results in error: version 0.4.2 #159

john8988 opened this issue Jun 20, 2019 · 8 comments

Comments

@john8988
Copy link

Summary (include Python version)

Python 3.7.2

I was having the 'client side error' issue for get_historical_data when using 0.4.1 version. For 0.4.1 version, I had NO issue for get_price() call. I updated to 0.4.2 today (6/20/2019) and now I'm getting the error:

iexfinance.utils.exceptions.IEXQueryError: An error occurred while making the query.

the stack dump:

b=a.get_price()

File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\stocks\base.py", line 756, in get_price
return self._get_endpoint("price", fmt_p=fmt_p)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\stocks\base.py", line 103, in _get_endpoint
data = self.fetch(fmt_j=fmt_j, fmt_p=no_pandas)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\base.py", line 209, in fetch
data = self._execute_iex_query(url)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\base.py", line 165, in _execute_iex_query
return self._handle_error(response)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\base.py", line 178, in _handle_error
raise IEXQueryError("The query could not be completed. "
iexfinance.utils.exceptions.IEXQueryError: An error occurred while making the query.

Date/time of issue

Expected behavior

Actual behavior

@addisonlynch
Copy link
Owner

Can you post a full code snippet? The following works for me:

from iexfinance.stocks import Stock

a = Stock("AAPL")
a.get_price()

@john8988
Copy link
Author

Here is the snippet of the code. It's on windows

from iexfinance.stocks import Stock
import os

os.environ["IEX_TOKEN"]="******"
a = Stock("AAPL")
b=a.get_price()
print(b)

Again getting the following:

Traceback (most recent call last):
File "C:\Users\Administrator\trade\test.py", line 6, in
b=a.get_price()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\stocks\base.py", line 756, in get_price
return self._get_endpoint("price", fmt_p=fmt_p)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\stocks\base.py", line 103, in _get_endpoint
data = self.fetch(fmt_j=fmt_j, fmt_p=no_pandas)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\base.py", line 209, in fetch
data = self._execute_iex_query(url)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\base.py", line 165, in _execute_iex_query
return self._handle_error(response)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\lib\site-packages\iexfinance\base.py", line 178, in _handle_error
raise IEXQueryError("The query could not be completed. "
iexfinance.utils.exceptions.IEXQueryError: An error occurred while making the query.

@addisonlynch
Copy link
Owner

What IEX_API_VERSION are you using?

@john8988
Copy link
Author

Didn't set. Not sure what version.

@john8988
Copy link
Author

Hi, I found out the problem: it was due to exceeding the free quota (500k message/mo). After I changed to another account, it worked.

It still puzzles me that I probably made a couple of hundreds of calls on get_price and get_historical_price and now it said exceeding the quota. I guess each price row (per day) in historical price counts as one message?

Thanks anyway for spending time on this.

@sl00k
Copy link

sl00k commented Jun 21, 2019

when i use get_historical_data.close for one day its way more than 1message. its weierd

@john8988
Copy link
Author

Just found out from API data weighting document:

Data Weighting

Adjusted + Unadjusted
10 per symbol per time interval returned (Excluding 1d)
Example: If you query for AAPL 5 day, it will return 5 days of prices for AAPL for a total of 50.

Adjusted close only
2 per symbol per time interval returned (Excluding 1d)
use chartCloseOnly param

So 10x how many days you are getting!!!

@sl00k
Copy link

sl00k commented Jun 21, 2019

wow what a bad joke is that.
but i think i will keep it for now. i have to look for others anyway. need europe market :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants