Registry / http-networking / polygon-api-client

polygon-api-client

JSON →
library1.16.3pypypi✓ verified 24d ago

The official Python client for Polygon.io's REST and Websocket APIs. This package (`polygon-api-client`) reached its end of life at version `1.16.3` and is no longer maintained. For active development, new features, and bug fixes, users should migrate to the successor library, `massive-api-client`.

pip install polygon-api-client==1.16.3
INSTALL
IMPORT
SIG · POLYGON-API-CLIENT
P
polygon-api-client
http-networkingpythonv1.16.3
Install
2.3s avg
Import
909ms
Disk
47MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.16.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 2.45s
py 3.11
✓ —
✓ 2.4s
py 3.12
✓ —
✓ 2.15s
py 3.13
✓ —
✓ 2.2s
py 3.9
1/2 runs
1/2 runs
47MB installed
● package 47MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

RESTClient
from polygon import RESTClient
WebSocketClient
from polygon.websocket import WebSocketClient

Initialize the REST client and fetch basic reference data. Ensure your API key is set via environment variable or directly in the code. This version of the client defaults to the `api.polygon.io` endpoint.

import os from polygon import RESTClient # Your Polygon API key API_KEY = os.environ.get("POLYGON_API_KEY", "YOUR_API_KEY_HERE") def main(): if not API_KEY or API_KEY == "YOUR_API_KEY_HERE": print("Please set the POLYGON_API_KEY environment variable or replace 'YOUR_API_KEY_HERE' in the code.") return try: with RESTClient(API_KEY) as client: # Example: Get ticker types (endpoint availability depends on your API plan) resp = client.reference_ticker_types() print(f"Ticker Types: {resp.results}") except Exception as e: print(f"An error occurred: {e}") if __name__ == "__main__": main()
Debug
Known issues
breakingThis `polygon-api-client` package is deprecated and no longer receives updates. The official client has been rebranded and released as `massive-api-client` (version `2.x.x` and higher). All users are strongly advised to migrate to the new package (`massive-api-client`) to receive critical updates, new features, and bug fixes.
fix
Uninstall `polygon-api-client` (`pip uninstall polygon-api-client`) and install the successor `massive-api-client` (`pip install massive-api-client`). Update your code to use the new package. The core `from polygon import ...` import structure generally remains the same, but new features and endpoint changes in `massive-api-client` may require code adjustments.
affects: All versions of `polygon-api-client` (including 1.16.3)
breakingUpon migrating from `polygon-api-client` (v1.x) to `massive-api-client` (v2.x+), the default API base URL changes from `https://api.polygon.io` to `https://api.massive.com`. While `https://api.polygon.io` still functions, ensure your code explicitly sets `base_url='https://api.polygon.io'` if you must connect to the old endpoint, or adapt your systems to the new `api.massive.com` default.
fix
When initializing the client with `massive-api-client`, either allow the new `https://api.massive.com` default or explicitly specify `RESTClient(API_KEY, base_url='https://api.polygon.io')`.
affects: Migration from `polygon-api-client` (v1.x) to `massive-api-client` (v2.x+)
gotchaAn API key is required for authentication with the Polygon.io API. The client will raise an error if an API key is not provided or is invalid.
fix
Pass your Polygon.io API key to the `RESTClient` or `WebSocketClient` constructor, or ensure it's available as the `POLYGON_API_KEY` environment variable.
affects: All versions
Errors
Common errors & fixes
polygon-api-client is deprecated — migrate to massive-api-client
Library reached EOL at v1.16.3, no longer maintained
fix
pip uninstall polygon-api-client && pip install massive-api-client — see https://checklist.day/registry/massive-api-client
ModuleNotFoundError: No module named 'polygon'
polygon-api-client not installed
fix
pip install polygon-api-client (or migrate to massive-api-client)
ImportError: cannot import name 'RESTClient' from 'polygon'
Incorrect import path
fix
from polygon import RESTClient
401 Client Error: Unauthorized for url: https://api.polygon.io
Missing or invalid POLYGON_API_KEY
fix
Set POLYGON_API_KEY env var or pass api_key= to RESTClient constructor
Upgrade
Version history
1.16.3latest on PyPI · released Oct 30, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
30
Resources
polygon-api-client — pip install polygon-api-client · libregistry