{"id":5372,"library":"polygon-api-client","title":"Polygon.io Official Python Client (Deprecated)","description":"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`.","status":"deprecated","version":"1.16.3","language":"en","source_language":"en","source_url":"https://github.com/polygon-io/client-python","tags":["financial data","stocks","options","forex","crypto","websocket","rest api","deprecated"],"install":[{"cmd":"pip install polygon-api-client==1.16.3","lang":"bash","label":"Install Last Maintained Version"},{"cmd":"pip install massive-api-client","lang":"bash","label":"Recommended: Install Successor Library"}],"dependencies":[],"imports":[{"symbol":"RESTClient","correct":"from polygon import RESTClient"},{"symbol":"WebSocketClient","correct":"from polygon.websocket import WebSocketClient"}],"quickstart":{"code":"import os\nfrom polygon import RESTClient\n\n# Your Polygon API key\nAPI_KEY = os.environ.get(\"POLYGON_API_KEY\", \"YOUR_API_KEY_HERE\")\n\ndef main():\n    if not API_KEY or API_KEY == \"YOUR_API_KEY_HERE\":\n        print(\"Please set the POLYGON_API_KEY environment variable or replace 'YOUR_API_KEY_HERE' in the code.\")\n        return\n\n    try:\n        with RESTClient(API_KEY) as client:\n            # Example: Get ticker types (endpoint availability depends on your API plan)\n            resp = client.reference_ticker_types()\n            print(f\"Ticker Types: {resp.results}\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n\nif __name__ == \"__main__\":\n    main()","lang":"python","description":"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."},"warnings":[{"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.","message":"This `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.","severity":"breaking","affected_versions":"All versions of `polygon-api-client` (including 1.16.3)"},{"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')`.","message":"Upon 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.","severity":"breaking","affected_versions":"Migration from `polygon-api-client` (v1.x) to `massive-api-client` (v2.x+)"},{"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.","message":"An 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}