fd-polygon
Polygon.io US equities datasource package for fd-open-data-mcp.
Exposes US equity market data (daily OHLCV bars, single-day OHLC, company
reference) from polygon.io via the official
polygon-api-client Python
package. It is the US-markets complement to akshare's A-share coverage.
Install
pip install fd-polygon
The package is discovered by
fd-open-data-mcpthrough thefd_open_data_mcp.datasourcesentry-point — install it into the same environment asfd-open-data-mcpand it auto-registers viaregister_discovered().
Authentication
The API key is read from the POLYGON_API_KEY environment variable at
runtime. It is never hardcoded in source. A missing/empty key makes the
provider raise FetchError, which the dispatcher treats like any unavailable
source (records an error outcome and fails over).
export POLYGON_API_KEY=tw_... # free-tier key from polygon.io/dashboard/api-keys
Functions
| Command | Polygon method | Frequency | Description |
|---|---|---|---|
polygon_aggs |
get_aggs (timespan=day) |
daily | US equity daily OHLCV bars over a range |
polygon_daily_open_close |
get_daily_open_close_agg |
daily | Single-day OHLC + pre/after-hours |
polygon_ticker_details |
get_ticker_details |
on_demand | Company reference snapshot (market cap, employees, SIC, CIK…) |
Concepts
OHLCV columns are bound to price.close / price.open / price.high /
price.low / price.vwap / trading_volume concepts for entity_type=stock
with unit=currency_usd (distinct from the A-share currency_cny concepts in
fd-world). Company facts (market_cap, total_employees) bind to
entity_type=company.
Dispatch wiring
fd-open-data-mcp's run_upstream() is a hardcoded source→runner chain. This
package adds the polygon branch:
if source == "polygon":
from fd_polygon.provider import run_polygon
return run_polygon(command, params)
run_polygon returns pandas DataFrames with a date column (YYYY-MM-DD) so the
dispatch fallback extraction finds values without a dedicated adapter.
Smoke test
export POLYGON_API_KEY=tw_...
python -c "
from fd_polygon.provider import run_polygon
# Use recent dates — the free tier's historical entitlement only covers ~2 yrs back.
df = run_polygon('polygon_aggs', {'ticker': 'AAPL', 'start': '2026-07-01', 'end': '2026-07-10'})
print(df)
"
Free-tier limits
- 5 API calls / minute.
- Historical entitlement window ≈ 2 years.
get_aggsandget_daily_open_close_aggonly serve dates within roughly the last two years (observed: 2024-09 returns, 2024-01 returnsNOT_AUTHORIZEDas of 2026-08). Older bars require a paid plan.get_ticker_detailsis not subject to this window. - Delayed intraday trades/quotes — not used by this package.
Metadata
Release files for fd-polygon 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fd_polygon-0.2.0.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fd_polygon-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.9 kB
Release files / fd_polygon-0.2.0.tar.gz
| Download URL | fd_polygon-0.2.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ee280c48fe12e5e707b48b06c9eae8c54302917094e36908b837a93f5ab6da9e
|
|
BLAKE2b-256 checksum How to use checksums |
1cd92bed7da423780843dd9aa7162aa8f260fd185d3bbff0542940cd20ce0084
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / fd_polygon-0.2.0-py3-none-any.whl
| Download URL | fd_polygon-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d03cb628edeeb2cb2e72ae817dcd8a32ed252050f670d8b00d364b7267b86e2c
|
|
BLAKE2b-256 checksum How to use checksums |
a04d8b4086bab1c9d64fb1bc0a9baee75e9823a1400491044d6124c781db4b7d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|