Polygon io

Learn how to use Polygon io with Composio

Overview

SLUG: POLYGON_IO

Description

Polygon.io provides real-time and historical market data APIs for stocks, options, forex, and cryptocurrencies, enabling developers to build financial applications with ease.

Authentication Details

generic_api_key
stringRequired
generic_api_key
stringRequired

Connecting to Polygon io

Create an auth config

Use the dashboard to create an auth config for the Polygon io toolkit. This allows you to connect multiple Polygon io accounts to Composio for agents to use.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Polygon io Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4polygon_io_auth_config_id = "ac_YOUR_POLYGON_IO_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Polygon io for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, polygon_io_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the [Polygon io toolkit’s playground](https://app.composio.dev/app/Polygon io)

For code examples, see the Tool calling guide and Provider examples.

Tool List

Tool Name: Get All Tickers

Description

Tool to retrieve a comprehensive list of supported ticker symbols across all asset classes. Use when you need to list all tickers with details like symbol, name, market, and status.

Action Parameters

active
cik
cursor
cusip
date
exchange
limit
market
order
search
sort
ticker
type

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Condition Codes

Description

Tool to retrieve a unified list of trade and quote condition codes and their definitions. Use when needing to decode condition identifiers after fetching market data.

Action Parameters

asset_class
data_type
id
limit
sort

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Crypto Aggregates

Description

Tool to get aggregate bars (OHLC) with volume and VWAP for cryptocurrency pairs over a date range in custom time windows. Use when you need historical crypto price data with configurable time intervals.

Action Parameters

adjusted
Defaults to True
crypto_ticker
stringRequired
from_date
stringRequired
limit
multiplier
integerRequired
sort
timespan
stringRequired
to_date
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Crypto EMA

Description

Tool to calculate Exponential Moving Average (EMA) technical indicator for a crypto ticker. Use when you need trend analysis or moving average calculations for cryptocurrency pairs.

Action Parameters

adjusted
Defaults to True
crypto_ticker
stringRequired
expand_underlying
limit
Defaults to 10
order
Defaults to desc
series_type
Defaults to close
timespan
Defaults to day
timestamp
timestamp.gt
timestamp.gte
timestamp.lt
timestamp.lte
window
Defaults to 50

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Crypto MACD

Description

Tool to calculate Moving Average Convergence/Divergence (MACD) technical indicator for a crypto ticker. Use when you need momentum analysis, trend identification, or trading signal generation for cryptocurrency pairs.

Action Parameters

adjusted
Defaults to True
crypto_ticker
stringRequired
expand_underlying
limit
Defaults to 10
long_window
integerRequired
order
Defaults to desc
series_type
Defaults to close
short_window
integerRequired
signal_window
integerRequired
timespan
Defaults to day
timestamp

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Crypto RSI

Description

Tool to calculate the Relative Strength Index (RSI) for a cryptocurrency ticker. Use when you need to analyze momentum or identify overbought/oversold conditions for crypto assets.

Action Parameters

adjusted
Defaults to True
crypto_ticker
stringRequired
expand_underlying
limit
Defaults to 5000
order
Defaults to desc
series_type
Defaults to close
timespan
Defaults to day
timestamp
timestamp.gt
timestamp.gte
timestamp.lt
timestamp.lte
window
Defaults to 14

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Crypto SMA

Description

Tool to calculate Simple Moving Average (SMA) technical indicator for a cryptocurrency ticker. Use when you need trend analysis, support/resistance levels, or trading signal generation for crypto pairs.

Action Parameters

adjusted
Defaults to True
crypto_ticker
stringRequired
expand_underlying
limit
Defaults to 5000
order
Defaults to desc
series_type
Defaults to close
timespan
stringRequired
timestamp
timestamp.gt
timestamp.gte
timestamp.lt
timestamp.lte
window
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Daily Ticker Summary

Description

Tool to retrieve daily aggregate summary for a specific stock ticker. Uses previous day aggregates from v2 API.

Action Parameters

adjusted
booleanDefaults to True
date
stringRequired
stocks_ticker
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Dividends

Description

Tool to retrieve a historical record of cash dividend distributions for a given ticker. Use when analyzing dividend payments by date, amount, and frequency.

Action Parameters

cash_amount
declaration_date
dividend_type
ex_dividend_date
frequency
limit
order
pay_date
record_date
sort
ticker

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Economy Inflation Indicators

Description

Tool to retrieve key indicators of realized inflation including CPI and PCE price indexes. Use when analyzing inflation trends, economic conditions, or historical price changes in the U.S. economy.

Action Parameters

date
limit
sort

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Exponential Moving Average

Description

Tool to retrieve the Exponential Moving Average for a stock ticker. Use when you need EMA values across a specific timespan with optional underlying data.

Action Parameters

adjusted
Defaults to True
expand_underlying
limit
Defaults to 100
order
Defaults to desc
series_type
Defaults to close
stock_ticker
stringRequired
timespan
stringRequired
window
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Forex Aggregates

Description

Tool to get aggregate bars for a forex pair over a date range in custom time windows. Use when you need historical forex price data with configurable time intervals.

Action Parameters

adjusted
Defaults to True
forex_ticker
stringRequired
from_date
stringRequired
limit
multiplier
integerRequired
sort
timespan
stringRequired
to_date
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Forex EMA

Description

Tool to calculate Exponential Moving Average (EMA) technical indicator for a forex pair. Use when you need trend analysis or moving average calculations for currency pairs.

Action Parameters

adjusted
Defaults to True
expand_underlying
forex_ticker
stringRequired
limit
Defaults to 10
order
Defaults to desc
series_type
Defaults to close
timespan
Defaults to day
timestamp
window
integerDefaults to 50

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Forex MACD

Description

Tool to calculate Moving Average Convergence/Divergence (MACD) technical indicator for a forex pair. Use when you need momentum analysis, trend identification, or trading signal generation for currency pairs.

Action Parameters

adjusted
Defaults to True
expand_underlying
forex_ticker
stringRequired
limit
Defaults to 10
long_window
integerRequired
order
Defaults to desc
series_type
Defaults to close
short_window
integerRequired
signal_window
integerRequired
timespan
stringRequired
timestamp
timestamp_gt
timestamp_gte
timestamp_lt
timestamp_lte

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Forex Real-Time Currency Conversion

Description

Tool to convert amounts between currency pairs using real-time forex rates. Use when you need to perform currency conversions with the latest market rates.

Action Parameters

amount
from_currency
stringRequired
precision
to_currency
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Forex RSI

Description

Tool to calculate the Relative Strength Index (RSI) technical indicator for a forex pair. Use when you need momentum analysis or want to identify overbought/oversold conditions for currency pairs.

Action Parameters

adjusted
Defaults to True
expand_underlying
forex_ticker
stringRequired
limit
Defaults to 5000
order
Defaults to desc
series_type
Defaults to close
timespan
stringRequired
timestamp
timestamp_gt
timestamp_gte
timestamp_lt
timestamp_lte
window
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Forex SMA

Description

Tool to calculate Simple Moving Average (SMA) technical indicator for a forex pair. Use when you need trend analysis or moving average calculations for currency pairs.

Action Parameters

adjusted
Defaults to True
expand_underlying
forex_ticker
stringRequired
limit
Defaults to 10
order
Defaults to desc
series_type
Defaults to close
timespan
Defaults to day
timestamp
timestamp.gt
timestamp.gte
timestamp.lt
timestamp.lte
window
Defaults to 50

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Futures Aggregates

Description

Tool to get aggregate bars (OHLC) with volume and VWAP for futures contracts over a date range in custom time windows. Use when you need historical futures price data with configurable time intervals.

Action Parameters

adjusted
Defaults to True
from_date
stringRequired
futures_ticker
stringRequired
limit
multiplier
integerRequired
sort
timespan
stringRequired
to_date
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Futures Quotes

Description

Tool to get real-time quote information for futures contracts with bid/ask prices, sizes, and timestamps. Use when you need to analyze current or historical quote data for futures trading decisions.

Action Parameters

futures_ticker
stringRequired
limit
order
sort
timestamp

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Historic Forex Ticks

Description

Tool to get historic ticks for a currency pair on a specific date. Use when you need historical forex tick-level data (ask/bid prices with timestamps) for a given day.

Action Parameters

date
stringRequired
from_currency
stringRequired
limit
offset
to_currency
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get IPO Data

Description

Tool to retrieve comprehensive information on Initial Public Offerings (IPOs), including upcoming and historical events. Use when analyzing IPO listing data by date range, ticker, or identifier.

Action Parameters

isin
limit
listing_date
listing_date_gte
listing_date_lte
order
sort
ticker
us_code

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get MACD

Description

Tool to retrieve the Moving Average Convergence/Divergence (MACD) for a stock ticker. Use when you need momentum analysis or signal generation over a specified timeframe.

Action Parameters

adjusted
Defaults to True
expand_underlying
limit
Defaults to 10
long_window
integerRequired
order
Defaults to desc
series_type
Defaults to close
short_window
integerRequired
signal_window
integerRequired
stock_ticker
stringRequired
timespan
stringRequired
timestamp

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Market Holidays

Description

Tool to retrieve upcoming market holidays and their corresponding open/close times. Use when planning around market schedules before trading.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Market Status

Description

Tool to retrieve the current trading status across major exchanges and currency markets. Use for real-time monitoring, scheduling, or UI updates.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get News

Description

Tool to retrieve the most recent news articles for a specified ticker. Use when you need summaries, source details, and sentiment analysis for market news.

Action Parameters

cursor
limit
order
published_utc.gte
published_utc.lte
sort
ticker

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Options Contract Overview

Description

Tool to retrieve comprehensive details about a specific options contract including contract type, exercise style, expiration date, strike price, and underlying ticker. Use when you need specifications for options contract analysis or strategy development.

Action Parameters

as_of
options_ticker
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Options Custom Bars

Description

Tool to retrieve historical OHLC and volume data for options contracts over custom date ranges with configurable time windows. Use when you need aggregate bars for options price analysis or strategy development.

Action Parameters

adjusted
Defaults to True
from_date
stringRequired
limit
multiplier
integerRequired
options_ticker
stringRequired
sort
timespan
stringRequired
to_date
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Options EMA

Description

Tool to calculate Exponential Moving Average (EMA) technical indicator for an options ticker. Use when you need trend analysis or moving average calculations for options contracts.

Action Parameters

adjusted
Defaults to True
expand_underlying
limit
Defaults to 10
options_ticker
stringRequired
order
Defaults to desc
series_type
Defaults to close
timespan
stringRequired
timestamp
timestamp.gt
timestamp.gte
timestamp.lt
timestamp.lte
window
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Options MACD

Description

Tool to calculate Moving Average Convergence/Divergence (MACD) technical indicator for an options ticker. Use when you need momentum analysis, trend identification, or trading signal generation for options contracts.

Action Parameters

adjusted
Defaults to True
expand_underlying
limit
Defaults to 10
long_window
integerRequired
options_ticker
stringRequired
order
Defaults to desc
series_type
Defaults to close
short_window
integerRequired
signal_window
integerRequired
timespan
stringRequired
timestamp
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Options RSI

Description

Tool to calculate Relative Strength Index (RSI) technical indicator for an options ticker. Use when you need momentum analysis or want to identify overbought/oversold conditions for options contracts.

Action Parameters

adjusted
Defaults to True
expand_underlying
limit
Defaults to 5000
options_ticker
stringRequired
order
Defaults to desc
series_type
Defaults to close
timespan
stringRequired
timestamp
timestamp_gt
timestamp_gte
timestamp_lt
timestamp_lte
window
Defaults to 14

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Options SMA

Description

Tool to calculate Simple Moving Average (SMA) technical indicator for an options ticker. Use when you need trend analysis or smoothed price data for options contracts.

Action Parameters

adjusted
Defaults to True
cursor
expand_underlying
limit
Defaults to 10
options_ticker
stringRequired
order
Defaults to asc
series_type
Defaults to close
timespan
stringRequired
timestamp
timestamp_gt
timestamp_gte
timestamp_lt
timestamp_lte
window
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get RSI

Description

Tool to retrieve the Relative Strength Index (RSI) for a stock ticker. Use after confirming ticker symbol and timespan to analyze momentum over a period.

Action Parameters

adjusted
Defaults to True
limit
Defaults to 5000
order
Defaults to desc
series_type
Defaults to close
stock_ticker
stringRequired
timespan
stringRequired
timestamp
timestampLimit
window
Defaults to 14

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Simple Moving Average

Description

Tool to retrieve the Simple Moving Average (SMA) for a forex ticker. Use when you need SMA values over a specified timespan with optional underlying data.

Action Parameters

adjusted
Defaults to True
expand_underlying
fx_ticker
stringRequired
limit
Defaults to 250
order
Defaults to desc
series_type
Defaults to close
timespan
stringRequired
timestamp
window
integerRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Splits

Description

Tool to retrieve historical stock split events for a given ticker. Use after identifying the ticker to fetch split history including ratio, ex-date, and record dates.

Action Parameters

asset_class
cursor
ex_date
execution_type
limit
order
sort
ticker

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Stocks Balance Sheets

Description

Tool to retrieve point-in-time balance sheet data including assets, liabilities, and equity from company SEC filings. Use when analyzing financial position with quarterly and annual history.

Action Parameters

cik
company_name
company_name_search
filing_date
filing_date_gt
filing_date_gte
filing_date_lt
filing_date_lte
include_sources
limit
order
period_of_report_date
period_of_report_date_gt
period_of_report_date_gte
period_of_report_date_lt
period_of_report_date_lte
sic
sort
ticker
timeframe

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Stocks Cash Flow Statements

Description

Tool to retrieve historical cash flow statement data from company SEC filings across quarterly, annual, and TTM frequencies. Use when analyzing cash generation, operating activities, investing activities, or financing activities.

Action Parameters

cik
company_name
company_name_search
filing_date
filing_date_gt
filing_date_gte
filing_date_lt
filing_date_lte
include_sources
limit
order
period_of_report_date
period_of_report_date_gt
period_of_report_date_gte
period_of_report_date_lt
period_of_report_date_lte
sic
sort
ticker
timeframe

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Stocks Custom Bars

Description

Tool to retrieve aggregated historical OHLC and volume data for a stock over custom date ranges with configurable time windows. Use when you need aggregate bars for stock price analysis, backtesting, or charting.

Action Parameters

adjusted
Defaults to True
from_date
stringRequired
limit
multiplier
integerRequired
sort
stocks_ticker
stringRequired
timespan
stringRequired
to_date
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Stocks Daily Market Summary

Description

Tool to retrieve daily OHLC, volume, and VWAP data for all U.S. stocks on a specified trading date. Use when you need to get grouped daily aggregate bars for all US stocks for a specific date.

Action Parameters

adjusted
booleanDefaults to True
date
stringRequired
include_otc
boolean

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Stocks Full Market Snapshot

Description

Tool to retrieve a comprehensive snapshot of the entire U.S. stock market covering 10,000+ actively traded tickers. Use when you need current market-wide data including pricing, volume, and trade activity. Data is cleared daily at 3:30 AM EST and repopulates as exchanges report new data starting around 4:00 AM EST.

Action Parameters

include_otc
tickers

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Stocks Income Statements

Description

Tool to retrieve comprehensive income statement data including revenue, expenses, and net income from company SEC filings. Use when analyzing profitability, revenue trends, or operational performance.

Action Parameters

cik
company_name
company_name_search
filing_date
filing_date_gt
filing_date_gte
filing_date_lt
filing_date_lte
include_sources
limit
order
period_of_report_date
period_of_report_date_gt
period_of_report_date_gte
period_of_report_date_lt
period_of_report_date_lte
sic
sort
ticker
timeframe

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Stocks Previous Day Bar

Description

Tool to retrieve the previous trading day's open, high, low, close (OHLC), and volume data for a stock ticker. Use when you need the most recent completed trading day's aggregate data.

Action Parameters

adjusted
Defaults to True
stocks_ticker
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Ticker Events

Description

Tool to retrieve timeline of ticker change events such as symbol renaming or rebranding. Use when tracking ticker history to maintain continuity in records and analyses. This is an experimental endpoint.

Action Parameters

id
stringRequired
types

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Ticker Overview

Description

Tool to retrieve comprehensive details for a single ticker, including identifiers, industry, and branding assets. Use after confirming the exact ticker symbol.

Action Parameters

ticker
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Get Ticker Types

Description

Tool to retrieve a list of all ticker types supported by Polygon.io. Use when you need to enumerate valid ticker types for filtering or validation.

Action Parameters

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Last Quote for a Symbol

Description

Tool to retrieve the last quote tick for a given stock symbol. Use when you need the most recent bid/ask prices, sizes, and exchange information for a stock.

Action Parameters

symbol
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired

Tool Name: Last Trade for a Currency Pair

Description

Tool to retrieve the last trade tick for a currency pair in the forex market. Use when you need the most recent trade price, exchange, and timestamp for a specific currency pair.

Action Parameters

from_currency
stringRequired
to_currency
stringRequired

Action Response

data
objectRequired
error
successful
booleanRequired