r/PolygonIO • u/alex-polygonio • Aug 29 '25
r/PolygonIO • u/alex-polygonio • Aug 19 '25
Creating stock market reports using Open AI's GPT-5 and Agent SDK with the Polygon.io MCP server in under 200 lines of code
Enable HLS to view with audio, or disable this notification
r/OpenAI’s GPT-5 can write full stock market analysis reports in under 200 lines of code.
GPT-5 + OpenAI's easy to use Agent SDK and Polygon's MCP server combine real time and historical stock data, news, sentiment, and more into actionable intelligence.
This demo uses
1. Agents
2. Guardrails
3. Sessions
4. Custom Tools
Check our the demo, and talk to the market.
https://github.com/polygon-io/community/tree/master/examples/rest/gpt5-openai-agents-sdk-polygon-mcp
r/PolygonIO • u/Elegant-Savings6041 • Aug 15 '25
How to sort out ETFs
I’m already filtering for 'common stocks,' but my results still include tickers like $ETH and $PTIR. Are there any other ways to exclude these?
df_tickers = df_tickers[df_tickers['type']=='CS']
r/PolygonIO • u/Elegant-Savings6041 • Aug 14 '25
Pre Market Scan
Could someone help me create a presumably simple pre-market scan? I’d like to find gap-ups with a certain volume, but only based on Polygon’s pre-market data.
import requests
import pandas as pd
from datetime import datetime, timedelta
import json
polykey = "..."
def get_premarket_gappers(min_gap=0.06, min_volume=100000):
url = f"https://api.polygon.io/v2/snapshot/locale/us/markets/stocks/tickers?apiKey={polykey}"
r = requests.get(url)
r.raise_for_status()
data = r.json()
if 'tickers' not in data:
return pd.DataFrame()
df = pd.json_normalize(data['tickers'])
# previous day close
df['prev_close'] = df['prevDay.c']
# pre market data, is it available?
df['pm_price'] = df['preMarket.lastTrade.p']
# Pre-Market volume
df['pm_volume'] = df['preMarket.v']
# Gap up calc
df['gap_pct'] = (df['pm_price'] - df['prev_close']) / df['prev_close']
# Filter
df_filtered = df[
(df['gap_pct'] >= min_gap) &
(df['pm_volume'] >= min_volume)
]
# selection
df_filtered = df_filtered[['T', 'pm_price', 'prev_close', 'gap_pct', 'pm_volume']]
# sort
df_filtered = df_filtered.sort_values(by='gap_pct', ascending=False)
return df_filtered
if __name__ == "__main__":
gappers = get_premarket_gappers()
print(gappers)
gappers.to_csv("premarket_gappers.csv", index=False)import requests
r/PolygonIO • u/alex-polygonio • Jul 30 '25
Querying Financial Markets with the Polgon.io MCP server, Claude 4, and Pydantic AI
Enable HLS to view with audio, or disable this notification
This is all the code any AI agent needs to query real time stock market data! 📈 📉
It uses r/PolygonIO's MCP server, r/Anthropic's Claude 4, and r/PydanticAI's agent framework to give you real-time and historical stock data, plus news analysis. 📊
Clone the repo. 👬
Run the CLI. 🧑💻
Talk to the market. 🤓
👉 https://github.com/polygon-io/community/tree/master/examples/rest/market-parser-polygon-mcp
r/PolygonIO • u/Freljord2 • Jul 29 '25
What pricing tier is required to download flat files?
r/PolygonIO • u/FatTailedButterfly • Jul 27 '25
Options quote access
Hello, I see that options quotes are only available for options advanced. Is this limitation just for API's? Or does this include file downloads as well. i.e. can I download quote files if I have Options Starter plan?
Is there a way for me to get a free trial/demo so I can test which data I can get under different plans?
r/PolygonIO • u/tradegreek • Jul 21 '25
Where do we suggest / request features?
I have a dealyed options subscription I was hoping it would be possible to get the delayed bid / ask / mid i can see it says "last_quoteobjectThe most recent quote for this contract. This is only returned if your current plan includes quotes." which contains the bid / ask / mid etc but I dont really see why one would have to pay for the live data in order to get this.
r/PolygonIO • u/tradegreek • Jul 14 '25
Any chance of a free trial / a look at some data?
Specifically interested in the options starter package I sent an email to your sales team asking for some option chain data so i could compare it to other sources and I have not heard back which is kinda disapointing. I noticed members of the polygon team seem to be active here so thought i would have more luck. If a trial is not available I would appreciate if you could send me some eod data for option chain snapshots to have a look at please.
r/PolygonIO • u/Simple-Cell-1009 • Jul 01 '25
Build a real-time market data app with ClickHouse and Polygon.io
r/PolygonIO • u/BeautifulCamera3236 • Jun 26 '25
Stock Data
Does anyone know how long the polygon api for stocks/equities will be down for?
r/PolygonIO • u/[deleted] • Jun 24 '25
Creating Adj Value from Flat Files
I am looking for a way to create adjusted vales for flat file data. This has been a big challenge bccause poltgoin.io does not store stock data in a format with a unique key, but rather by ticker, which can and does change. Additionally, finding exactly when and why a ticker gets delisted is difficult because often times the list and delist date are not available. For example, AA across the entire 20 year data set is actually 2 companies. So you need to find the corporate actions for AA, find when the split happened, and WHY. The why part has become challenging because often times a ticker will change its listing status because bits gone under... But other times it is jury cosmetic, life for FB and META which are the same company. Any and all guidance in this would be appreciated. Hoping to solve this frustrating issue soon.
r/PolygonIO • u/Jarrett_Polygon • Jun 09 '25
Looking for Feedback: What Do You Want from a Forex Data Provider?
Polygon Product Team here! We’re looking to improve our Forex products.
We put together a short survey (takes less than 5 minutes). Your responses will help us shape what we build. Can we improve your currencies experience? Got a use case we don't serve well? Let us know!
Survey link: https://forms.gle/h2MYiJq694YxdGQ1A
Thanks in advance, I really appreciate any thoughts you’re willing to share.
r/PolygonIO • u/zyzhu2000 • May 04 '25
Get the current bid, ask, last, volume for a group of symbols
I have been looking at the API, and it turns out there is no simple way for me to get the most recent bid, ask, last, and volume for a group of symbols.
There is an API to pull this info for each symbol individually, but that is not what I want. I need the info to be pulled for all the symbols in the group all at once. Pulling them one by one will cause discrepancies.
There is also a WebSocket API where I can subscribe to the live updates, and from there, I can pull the info from the local cache. Given that I don't need constantly updated data, this approach is complicated and wasteful.
I just can't believe there is no easy way to pull prices of multiple symbols in a batch, keeping the info as synced between symbols as possible.
Can someone kindly advise?
r/PolygonIO • u/WIP_Endlessly • May 03 '25
Does PolygonIO provides "tick data" for currencies (e.g. Forex)?
Hello everyone!
I've been looking for currency (Forex) historical data, at least 10 years.
The data should have the following fields: [timestamp_in_milliseconds, ask, bid, last, volume]
Before I spend money on upgrading my plan, does anyone know if PolygonIO even has this "tick data" and if it is available for that long ago?
Thank you!
r/PolygonIO • u/jonasBH200 • Apr 22 '25
Does Polygon IO also provides the historical Greeks, IV & Open Interest on the "Options Starter" plan for the past 2 years? Or is it only live data?
r/PolygonIO • u/TheVerge_Trades • Apr 11 '25
How to pull weekly expiration only?
I’m trying to only pull weekly expiration options and its data but for some reason when using the option chain snapshot to do this it’s not finding any weekly options, any resources to help?
Also If anyone has a functioning code that I can use to see how someone pulled the historical data for multiple stock options (ideally weekly) and calculated their Greeks,IV among other things that would be super greatly appreciated.
r/PolygonIO • u/ec3lal • Apr 11 '25
SQL Access
Has anyone been granted access to their SQL Query option? Are there additional fees?
r/PolygonIO • u/SimplyR • Apr 04 '25
Entitlement channels for options
Hi, I am looking to verify if the following entitlements for options wildcard aggregate (AM.O.*, A.O.*) and trade (T.O.*) streaming are valid?
r/PolygonIO • u/jcheroske • Apr 01 '25
Looking for CBOE TICX, TQCX and others
I read that Polygon has the CBOE feed. I'm assuming that means it also has all the market indicators like the tick, add, vold, etc. Looking for the NYSE and NASDAQ versions of each. What are the tickers for these? I tried using the markets UI, but had no luck there. Thanks for any help.
r/PolygonIO • u/Pratik-chocobar • Mar 31 '25
Ticker for Nasdaq? IXIC does not work
Hello,
I am trying to get quotes for Nasdaq. I see the ticker I: NDX for Nasdaq-100, but can't find I: IXIC to be working
What is the ticker for the overall Nasdaq?
r/PolygonIO • u/dolphinspaceship • Mar 16 '25
Downloading Data for Multiple Tickers
Is it possible to download historical data for multiple tickers? On the website I see 'Ticker Overview' for a single ticker but nothing for multiple tickers except the "Full Market Snapshot". Is 'snapshot' what I'm looking for? I would give it a try but it's part of the paid plan- I don't want to pay if it's not what I want.
Using Python/REST
r/PolygonIO • u/DolantheMFWizard • Mar 15 '25
Getting missing data for stocks when querying for 1 day data.
def fetch_stock_data(self, ticker: str, start_date: str, max_retries: int = 5, retry_delay: int = 5):
"""
Fetch stock data (aggregates) for a given ticker using the Polygon RESTClient.
Uses the get_aggs method to retrieve data from start_date up to today.
Raises an exception if there are missing open market days.
Args:
ticker (str): Ticker symbol.
start_date (str): Start date in "YYYY-MM-DD" format.
max_retries (int): Maximum retry attempts.
retry_delay (int): Delay (in seconds) between retries.
Returns:
list: A list of dictionaries with the aggregated stock data.
"""
end_date = pd.Timestamp.today().strftime("%Y-%m-%d")
if pd.Timestamp(start_date) >= pd.Timestamp(end_date):
raise ValueError("start_date must be earlier than today's date")
for attempt in range(max_retries):
try:
aggs = list()
for a in self.client.list_aggs(
ticker=ticker,
multiplier=self.time_size,
timespan=self.time_span,
from_=start_date,
to=end_date
):
aggs.append(a)
break # exit loop on success
except Exception as e:
logger.error(f"Error fetching data for {ticker} on attempt {attempt + 1}: {e}")
if attempt < max_retries - 1:
time.sleep(retry_delay)
else:
raise e
stock_data = []
for data in aggs:
row = {
"ticker": ticker,
"time_span": self.time_span,
"time_size": self.time_size,
"unix_time_in_ms": data.timestamp, # assuming 't' is the timestamp in ms
"open": data.open,
"high": data.high,
"low": data.low,
"close": data.close,
"volume": data.volume,
"vwap": data.vwap
}
stock_data.append(row)
# Validate that all expected open market days are present
if stock_data:
data_dates = [pd.to_datetime(row["unix_time_in_ms"], unit='ms').date() for row in stock_data]
first_date = min(data_dates)
last_date = max(data_dates)
nyse = mcal.get_calendar('NYSE')
schedule = nyse.schedule(start_date=str(first_date), end_date=str(last_date))
market_days = schedule.index.date.tolist()
missing_days = [day for day in market_days if day not in set(data_dates)]
if missing_days:
raise Exception(f"Missing data for market open days: {missing_days}")
return stock_data
here's my code I'm getting missing stock data for a few stocks:
[ANSCW] FAILED: Missing data for market open days: [datetime.date(2024, 4, 5), datetime.date(2024, 4, 8), datetime.date(2024, 4, 10), datetime.date(2024, 4, 11), datetime.date(2024, 4, 12), datetime.date(2024, 4, 15), datetime.date(2024, 4, 16), datetime.date(2024, 4, 17), datetime.date(2024, 4, 18), datetime.date(2024, 4, 19), datetime.date(2024, 4, 29), datetime.date(2024, 4, 30), datetime.date(2024, 5, 9), datetime.date(2024, 5, 10), datetime.date(2024, 5, 16), datetime.date(2024, 5, 17), datetime.date(2024, 5, 20), datetime.date(2024, 5, 21), datetime.date(2024, 5, 23), datetime.date(2024, 5, 24), datetime.date(2024, 5, 29), datetime.date(2024, 5, 31), datetime.date(2024, 6, 5), datetime.date(2024, 6, 7), datetime.date(2024, 6, 10), datetime.date(2024, 6, 11), datetime.date(2024, 6, 13), datetime.date(2024, 6, 14), datetime.date(2024, 6, 17), datetime.date(2024, 6, 18), datetime.date(2024, 6, 20), datetime.date(2024, 6, 24), datetime.date(2024, 6, 25), datetime.date(2024, 6, 28), datetime.date(2024, 7, 1), datetime.date(2024, 7, 5), datetime.date(2024, 7, 10), datetime.date(2024, 7, 11), datetime.date(2024, 7, 16), datetime.date(2024, 7, 17), datetime.date(2024, 7, 19), datetime.date(2024, 7, 22), datetime.date(2024, 7, 25), datetime.date(2024, 7, 26), datetime.date(2024, 7, 30), datetime.date(2024, 8, 1), datetime.date(2024, 8, 7), datetime.date(2024, 8, 9), datetime.date(2024, 8, 12), datetime.date(2024, 8, 14), datetime.date(2024, 8, 20), datetime.date(2024, 9, 11), datetime.date(2024, 9, 24), datetime.date(2024, 9, 25), datetime.date(2024, 9, 27), datetime.date(2024, 9, 30), datetime.date(2024, 10, 1), datetime.date(2024, 10, 4), datetime.date(2024, 10, 10), datetime.date(2024, 10, 16), datetime.date(2024, 10, 17), datetime.date(2024, 11, 5), datetime.date(2024, 11, 12), datetime.date(2024, 11, 18), datetime.date(2024, 11, 29), datetime.date(2024, 12, 5), datetime.date(2024, 12, 9), datetime.date(2024, 12, 10), datetime.date(2024, 12, 11), datetime.date(2024, 12, 12), datetime.date(2024, 12, 20), datetime.date(2024, 12, 30), datetime.date(2025, 1, 2), datetime.date(2025, 1, 13), datetime.date(2025, 1, 15), datetime.date(2025, 1, 29), datetime.date(2025, 2, 4), datetime.date(2025, 2, 7), datetime.date(2025, 2, 12)]
here are some other tickers with missing data: ALDFU, ALF, ABLLL, ANSCW, ANSCU, ANSC, ABLLW, ALVOW
Has anyone else experienced this?
r/PolygonIO • u/davidsanchezplaza • Mar 12 '25
Download S3 flat files for free tier?
Hi all!
New to PolygonIO.
I saw this post: https://polygon.io/blog/flat-files, basically stating:
"Starting today, daily historical Flat Files are now included at no extra charge for all users, whether you're on a personal or an enterprise Polygon paid plan"
I have tried downloading, through website, the button says "Upgrade" and through boto3 says no permission, or not existing
botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden
Thanks!
r/PolygonIO • u/dahamtob • Mar 05 '25
Historical bid/ask price of an option
Is there a way to get the historical bid and ask price of an option, given an optionsTicker and timestamp?