-
Notifications
You must be signed in to change notification settings - Fork 97
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
Options Chain command (options_chain) errors out while retrieving information #16
Comments
I've been seeing the same issue. I'm not sure why this is happening. I'm going to look into a fix myself. My initial thoughts are that the validation on responses is incorrect and throwing this exception erroneously. Using the API documentation I was able to find https://finnhub.io/api/v1/stock/option-chain?symbol=TSLA which works without an API key in my browser. So in the mean time it may just be best to setup something with bs4 to grab the info from https. If you have any ideas that are causing this issue, let me know here. I'd be excited to actually resolve this issue. |
Okay, so I figured out the root cause. It turns out that the api is returning the message without encoding. i.e. content-type = 'text/plain'. client.py:L52 with raise the exception that we see here. In the mean time you can add an if statement to handle this specific call. I have a hunch that this is the expected behavior by the client, and the real issue lies with the API not setting the content-type to be application/json. I'll make a pull request either way to fix this. |
Pull request I mentioned above: #18 @nongdenchet |
hey guys I have been busy recently. Let's me have a look |
Please upgrade your library to |
I have tested and confirmed that the issue is fixed for me. Thank you @KurtPrice |
while using the options.chain command in jupyter notebook, the code block displayed at the end of this issue errors out. In the error description, I can read the following
followed by the actual information I was requesting which is too lengthy to show here.
The code producing this error is this:
The text was updated successfully, but these errors were encountered: