Skip to main content
The official Python SDK provides fully typed synchronous and asynchronous clients for the Polar API.
The new SDK is currently in public preview. Install the pre-release explicitly to try it before the stable release.

Installation

The SDK requires Python 3.11 or later.
Terminal

Quickstart

Create an organization access token, store it in POLAR_ACCESS_TOKEN, and make your first request:
main.py

Async client

Use PolarAsync in asynchronous applications:
async_main.py
The import path pins your client to the 2026-04 API version.

Context managers

Both clients support context managers to close their HTTP connections automatically when the block exits. For synchronous applications, use Polar with with:
For asynchronous applications, use PolarAsync with async with:

Sandbox environment

The client uses production by default. Pass environment="sandbox" to use the isolated sandbox environment:
View the source code on GitHub.