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]

get_ticker_news(ticker: str) Optional[dict][source]¶

Get the most recent news articles relating to a stock ticker symbol, including a summary of the article and a link to the original source.

/v2/reference/news

Parameters

ticker (str) –

Return type

Optional[dict]

run(mode: str, ticker: str, **kwargs: Any) str[source]¶
Parameters
  • mode (str) –

  • ticker (str) –

  • kwargs (Any) –

Return type

str

Examples using PolygonAPIWrapper¶