Skip to main content

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-mcp through the fd_open_data_mcp.datasources entry-point — install it into the same environment as fd-open-data-mcp and it auto-registers via register_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_aggs and get_daily_open_close_agg only serve dates within roughly the last two years (observed: 2024-09 returns, 2024-01 returns NOT_AUTHORIZED as of 2026-08). Older bars require a paid plan. get_ticker_details is not subject to this window.
  • Delayed intraday trades/quotes — not used by this package.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fd_polygon-0.2.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fd_polygon-0.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file fd_polygon-0.2.0.tar.gz.

File metadata

  • Download URL: fd_polygon-0.2.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for fd_polygon-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ee280c48fe12e5e707b48b06c9eae8c54302917094e36908b837a93f5ab6da9e
MD5 d579849fcd876d8a73250a1f8f876f7d
BLAKE2b-256 1cd92bed7da423780843dd9aa7162aa8f260fd185d3bbff0542940cd20ce0084

See more details on using hashes here.

File details

Details for the file fd_polygon-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: fd_polygon-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.13

File hashes

Hashes for fd_polygon-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d03cb628edeeb2cb2e72ae817dcd8a32ed252050f670d8b00d364b7267b86e2c
MD5 ff5e6722333ddd1cdbfc192f22b2dcff
BLAKE2b-256 a04d8b4086bab1c9d64fb1bc0a9baee75e9823a1400491044d6124c781db4b7d

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page