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

I want to add net_income_loss field for stock financials vx api #715

Closed
tsugumi-sys opened this issue Jul 24, 2024 · 2 comments
Closed

I want to add net_income_loss field for stock financials vx api #715

tsugumi-sys opened this issue Jul 24, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@tsugumi-sys
Copy link

The net_income_loss field is not found in this library (data model definition), but the original api endpoint returns the net_income_loss field.

image
https://polygon.io/docs/stocks/get_vx_reference_financials

Can we add this field and other related fields for this library?
I'd like to contribute if it's ok :)

@tsugumi-sys tsugumi-sys added the enhancement New feature or request label Jul 24, 2024
@justinpolygon justinpolygon self-assigned this Jul 24, 2024
@justinpolygon
Copy link
Contributor

Thanks for posting this I'll check it out. Thanks for the PR.

@justinpolygon
Copy link
Contributor

This is fixed now via #817 and is in the latest release https://github.com/polygon-io/client-python/releases/tag/v1.14.3.

You should be able to just run pip install -U polygon-api-client to get the latest update.

Here's an example for fetching diluted_earnings_per_share and net_income_loss:

from polygon import RESTClient

client = RESTClient()  # POLYGON_API_KEY environment variable is used

financials = []
for f in client.vx.list_stock_financials("AAPL", filing_date="2024-11-01"):
    financials.append(f)

    # get diluted_earnings_per_share
    print(f.financials.income_statement.diluted_earnings_per_share)

    # get net_income_loss
    print(f.financials.income_statement.net_income_loss)

Here's the output:

$ python3 examples/rest/stocks-stock_financials.py

DataPoint(
    label="Diluted Earnings Per Share",
    order=4300,
    unit="USD / shares",
    value=6.08,
    derived_from=None,
    formula=None,
    source=None,
    xpath=None,
)
DataPoint(
    label="Net Income/Loss",
    order=3200,
    unit="USD",
    value=93736000000.0,
    derived_from=None,
    formula=None,
    source=None,
    xpath=None,
)
DataPoint(
    label="Diluted Earnings Per Share",
    order=4300,
    unit="USD / shares",
    value=6.08,
    derived_from=None,
    formula=None,
    source=None,
    xpath=None,
)
DataPoint(
    label="Net Income/Loss",
    order=3200,
    unit="USD",
    value=93736000000.0,
    derived_from=None,
    formula=None,
    source=None,
    xpath=None,
)

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

Successfully merging a pull request may close this issue.

2 participants