Skip to content

Client

polestar_api.client

Main entry point for the Polestar API client.

PolestarApi

PolestarApi(email: str, password: str, *, token_store: TokenStore | None = None)

Async client for the Polestar vehicle API.

Usage::

async with PolestarApi(email="...", password="...") as api:
    vehicles = await api.get_vehicles()
    battery = await vehicles[0].get_battery()
    if battery is not None:
        print(battery.charge_level)

async_init async

async_init() -> None

Authenticate and discover endpoints. Must be called before use.

get_vehicles async

get_vehicles() -> list[Vehicle]

Fetch the user's vehicles.

get_vehicle async

get_vehicle(vin: str) -> Vehicle

Get a specific vehicle by VIN.

close async

close() -> None

Close all connections.