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

Some Stocks endpoints return incorrectly #34

Closed
addisonlynch opened this issue Feb 19, 2018 · 2 comments
Closed

Some Stocks endpoints return incorrectly #34

addisonlynch opened this issue Feb 19, 2018 · 2 comments
Labels
Milestone

Comments

@addisonlynch
Copy link
Owner

It appears that some endpoints (such as get_earnings are returning incorrectly-formatted data)

from iexfinance import Stock

aapl = Stock("AAPL", output_format='pandas')
aapl.get_earnings()

#                                                                            AAPL
# earnings [{'fiscalPeriod': 'Q4 2017', 'announceTime': '...
# symbol                                                                     AAPL

This is incorrect. In addition, odd behavior is that get_earnings sometimes returns with a symbol index, and sometimes does not. This would cause calls like aapl.get_earnings()["totalDebt"] to fail.

@addisonlynch
Copy link
Owner Author

The Stocks/earnings and Stocks/financials endpoints return differently than the rest of the group, in that they have an extra dictionary level:

{
  "symbol": "AAPL",
  "earnings": [
    {
      "actualEPS": 2.1,
      "consensusEPS": 2.02
      ...

This causes some requests to return a symbol-indexed dictionary of the endpoint instead of the actual endpoint. This also causes pandas format to be incorrect.

@addisonlynch
Copy link
Owner Author

Merged #35.

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

No branches or pull requests

1 participant