Skip to content

Conversation

@justinpolygon
Copy link
Collaborator

@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
Collaborator 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.

3 participants