polygon-api-client
Official Polygon.io REST and Websocket client.
What it is and what it does
This is the official Python client for Massive (rebranded from Polygon.io on October 30, 2025), providing both REST and WebSocket interfaces to financial market data. The REST client handles stock trades, quotes, aggregates (OHLCV bars), and options chains with automatic pagination by default, while the WebSocket client streams real-time tick data for subscribed symbols. The library abstracts away connection management, pagination logic, and API authentication, letting you focus on data retrieval.
The package depends on urllib3 for HTTP requests, websockets for real-time connections, and certifi for SSL certificate validation. It supports Python 3.9 and newer, with no system-level compiled dependencies. Pagination is enabled by default for list endpoints, meaning the limit parameter controls page size rather than total results—you can disable this if you need a fixed result count. The client includes debug mode for inspecting request and response details.
Use it for:
- Fetch historical stock trades and quotes for backtesting trading strategies or analyzing market microstructure.
- Stream real-time tick data via WebSocket for live trading systems or market monitoring dashboards.
- Query options chains with filter parameters for options analysis and research.
- Build data pipelines that aggregate OHLCV bars at various timeframes for technical analysis.
- Retrieve last trade and quote snapshots for current market price lookups in applications.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides REST and WebSocket client libraries for accessing Massive financial market data APIs, including stock trades, quotes, aggregates, and options chains.
Yes. The package has low install friction, active maintenance, no known vulnerabilities, permissive licensing, and broad Python version support. It is the official client for a widely-used financial data API, making it the natural choice if you need Massive market data in Python. The main constraint is needing a valid API key and accepting the free tier's rate limits.
Install
polygon-api-client on PyPI
pip
pip install polygon-api-clientuv
uv add polygon-api-clientpoetry
poetry add polygon-api-clientInstalling polygon-api-client
Before you install
Low install friction with only three runtime dependencies (urllib3, websockets, certifi). Actively maintained with recent commits and 1496 repository stars. Supports Python 3.9 through 3.14.
License in practice
MIT license permits commercial and private use with minimal restrictions, making it suitable for most projects.
Quickstart
pip install -U massive
from polygon_api_client import RESTClient
client = RESTClient(api_key="<API_KEY>")
trades = [t for t in client.list_trades(ticker="AAPL", timestamp="2022-01-04")]
Requires a Massive API key. API free tier has usage limitations and may trigger rate limits.
Verify before relying
- Exact rate limit thresholds and behavior under free tier usage.
- WebSocket reconnection and error handling behavior in production scenarios.
- Performance characteristics when fetching very large historical datasets.
- Whether import path is 'polygon_api_client' or 'massive' in current version.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4.0,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — urllib3, websockets, certifi |
| Maintenance | actively maintained — 288 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 793,154/month — #5,043 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: polygon_api_client-1.16.3-py3-none-any.whl
Keywords: polygon, free, rest, stock, market, data, api, polygon.io, websocket, client
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
massiveOfficial Python client for Massive's REST and…
permissive · top 15,000 on PyPI
longbridgeLongbridge provides a Python SDK for accessing…
unclear · top 15,000 on PyPI
coinbase-advanced-pyOfficial Python SDK for the Coinbase Advanced…
permissive · top 15,000 on PyPI
python-kraken-sdkProvides REST and WebSocket clients for trading…
permissive · top 15,000 on PyPI
py-clob-clientPython client library for trading on…
permissive · top 15,000 on PyPI
sec-apiA Python client for the SEC-API.io service that…
permissive · top 15,000 on PyPI
finnhub-pythonFinnhub-python is a client library for the…
permissive · top 15,000 on PyPI
binance-connectorConnects Python applications to Binance's…
permissive · top 15,000 on PyPI
yfinanceFetches financial and market data from Yahoo…
permissive · top 1,000 on PyPI
yahooqueryRetrieves financial data from Yahoo Finance…
permissive · top 15,000 on PyPI