Mastering Polygon IO Toolkit: Everything You Need to Know

Published On Thu Aug 15 2024
Mastering Polygon IO Toolkit: Everything You Need to Know

Polygon IO Toolkit and Tools | 🦜️ LangChain

This notebook demonstrates how to utilize agents to interact with the Polygon IO toolkit. The toolkit offers access to Polygon's Stock Market Data API. In order to use the Polygon IO tools, you will need to install the langchain-community package. Obtain your Polygon IO API key here and then set it up below. It is also beneficial (though not mandatory) to configure LangSmith for top-tier observability.

Get Historical Stock Price Data From Polygon.io API In Python

Exploring the Polygon IO Toolkit

Polygon IO offers a comprehensive toolkit that includes both the toolkit itself and individual tools for each component. Let's begin by examining the usage of the toolkit before delving into the individual tools.

To initialize the toolkit, import it along with the API wrapper necessary for utilizing the tools. Take a look at the tools integrated into this toolkit:

We can add our toolkit to an agent and start utilizing it. For example, we can review yesterday's information for a specific ticker, inquire about recent news related to a stock, or request financial details for a company. Additionally, accessing live data is an option, but it necessitates a "Stocks Advanced" subscription.

For comprehensive documentation on all the features and configurations of the Polygon IO toolkit, refer to the API reference here.

Exploring Individual Polygon IO Tools

Let's start by configuring the API wrapper that will be used for all the tools and then proceed to understand each one:

  1. This tool displays aggregate information for a stock.
  2. Provides general financial information about a stock.
  3. Offers insights into the live data of a stock, requiring a "Stocks Advanced" subscription.
  4. Delivers recent news concerning a specific ticker.
Build a stock app with Polygon.io and Streamlit | Polygon

For detailed guidance on each of the Polygon IO tools, check out the respective API references.