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.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:
In a serverless function, call 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.

Learn more