Skip to main content
polar-sdk is the official Python client for the Polar API, with synchronous and asynchronous clients. It requires Python 3.11 or later.

Install

Terminal

Create a client

Create an organization access token in Settings → Access Tokens, or run polar auth token, and store it in POLAR_ACCESS_TOKEN. Then make your first request:
main.py
The import path pins the client to API version 2026-10: its types and the Polar-Version header it sends. See SDKs.

Async client

Use PolarAsync in asynchronous applications:
async_main.py
Both clients work as context managers, 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 extends polar.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:
See Handle deliveries for a full handler.

Send usage events

polar.events.ingest sends a list of usage events in one request:
See Send events for batching, duplicates and limits.

Learn more