polar-sdk is the official Python client for the Polar API, with synchronous and asynchronous clients. It requires Python 3.11 or later.
Install
- uv
- pip
Terminal
Create a client
Create an organization access token in Settings → Access Tokens, or runpolar auth token, and store it in POLAR_ACCESS_TOKEN. Then make your first request:
main.py
2026-10: its types and the Polar-Version header it sends. See SDKs.
Async client
UsePolarAsync in asynchronous applications:
async_main.py
with Polar(...) and async with PolarAsync(...), and close their HTTP connections when the block exits.
Options
List resources
List methods return one page.iter_list yields every item across pages:
Handle errors
Every SDK error extendspolar.PolarError. Errors the API documents, such as ResourceNotFound, have their own classes in polar.v2026_10.errors:
Verify webhooks
validate_event checks the signature and returns a typed event:
Send usage events
polar.track on PolarAsync adds an event to the SDK’s queue and returns. The SDK sends queued events in batches in the background, and leaving the async with block sends what’s left:
await polar.flush() before returning. The synchronous Polar client has no queue: send events with polar.events.ingest(events=[...]) instead. See Send events for configuring the queue, duplicates and limits.

