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.1.0.tar.gz (7.6 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.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fd_polygon-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 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.1.0.tar.gz
Algorithm Hash digest
SHA256 fcd66ee06773d5ccec63aadac717e48c67bc2060f351f487afa42c43ac56e506
MD5 1a227d9b10a9b7c2f3019495f60a1ce1
BLAKE2b-256 cdb4fad05949194f992ba8a51b7bc62efbf37cf0b80901c4591335e8a7355b8d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fd_polygon-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3c78a5425c044bcb0e843a655941ad0607ca815f122a57b855cd7b11e1f74ce
MD5 430b07ed751cec8b7a686ae7e5ed0579
BLAKE2b-256 05fbf81648e01b71c9defae0245d9fc9033daa27961c9a9744ed69bd2389e875

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

This release

0.1.0 This release

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