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

Added Short Interest and IPOs support #760

Closed
wants to merge 4 commits into from

Conversation

justinpolygon
Copy link
Contributor

@justinpolygon justinpolygon commented Oct 9, 2024

Update client with Short Interest and IPOs support. This PR adds list_short_interest and list_ipos functions and working examples.

Short Interest

from polygon import RESTClient

client = RESTClient()  # POLYGON_API_KEY environment variable is used

short_interest = []
for si in client.list_short_interest(
    identifier="AMD",
    identifier_type="ticker",
    params={
        "date.gte": "2024-10-07",
        "date.lte": "2024-10-07",
    },
    limit=100
):
    short_interest.append(si)

print(short_interest)
$ python examples/rest/stocks-short_interest.py
[
    ShortInterest(
        currency_code="USD",
        date="2024-10-07",
        isin="US0079031078",
        name="Advanced Micro Devices Inc.",
        security_description="Ordinary Shares",
        short_volume=9180696,
        short_volume_exempt=48277,
        ticker="AMD",
        us_code="007903107",
    )
]

Company IPOs

from polygon import RESTClient

client = RESTClient()  # POLYGON_API_KEY environment variable is used

ipos = []
for ipo in client.list_ipos(ticker="RDDT"):
    ipos.append(ipo)

print(ipos)
$ python examples/rest/stocks-ipos.py
[
    IPOListing(
        currency_code="USD",
        final_issue_price=34.0,
        highest_offer_price=34.0,
        ipo_status="history",
        isin="US75734B1008",
        issue_end_date=None,
        issue_start_date=None,
        issuer_name="Reddit Inc.",
        last_updated="2024-03-26",
        listing_date="2024-03-21",
        listing_price=None,
        lot_size=None,
        lowest_offer_price=31.0,
        max_shares_offered=22000000,
        min_shares_offered=None,
        primary_exchange="XNYS",
        security_description="Ordinary Shares - Class A",
        security_type="CS",
        shares_outstanding=36871367,
        ticker="RDDT",
        total_offer_size=519401918.0,
        us_code="75734B100",
    )
]

@justinpolygon justinpolygon marked this pull request as ready for review October 9, 2024 23:41
@lukeoleson
Copy link

Looks good to me, but I think we should probably just pull out the Short Interest stuff for now if we want to get this PR out sooner rather than later.

IPOs is live in prod, but short-interest is still underway. The short-interest data from EDI was incomplete, and we are looking at sourcing this from Finra directly instead. I don't think anything breaking will change in the API, it should just be additive stuff once we start using Finra, but if you wanted to get the IPOs stuff out now maybe we could split this into two PRs.

@justinpolygon
Copy link
Contributor Author

Closing -- only adding IPOs via #816.

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

Successfully merging this pull request may close these issues.

2 participants