langchain_community.utilities.polygon
.PolygonAPIWrapper¶
- class langchain_community.utilities.polygon.PolygonAPIWrapper[source]¶
Bases:
BaseModel
Wrapper for Polygon API.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- param polygon_api_key: Optional[str] = None¶
- get_aggregates(ticker: str, **kwargs: Any) Optional[dict] [source]¶
Get aggregate bars for a stock over a given date range in custom time window sizes.
/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_date}/{to_date}
- Parameters
ticker (str) –
kwargs (Any) –
- Return type
Optional[dict]
- get_financials(ticker: str) Optional[dict] [source]¶
Get fundamental financial data, which is found in balance sheets, income statements, and cash flow statements for a given ticker.
/vX/reference/financials
- Parameters
ticker (str) –
- Return type
Optional[dict]
- get_last_quote(ticker: str) Optional[dict] [source]¶
Get the most recent National Best Bid and Offer (Quote) for a ticker.
/v2/last/nbbo/{ticker}
- Parameters
ticker (str) –
- Return type
Optional[dict]