Skip to main content

Sunsynk API Client

CI

An API client library for reading data from the Sunsynk API that is used by the Sunsynk Connect apps and PowerView portal.

Install

pip install sunsynk-api-client

Example Usage

import asyncio
import os

from sunsynk.client import SunsynkClient


async def main():
    sunsynk_username = os.getenv('SUNSYNK_USERNAME')
    sunsynk_password = os.getenv('SUNSYNK_PASSWORD')

    async with SunsynkClient(sunsynk_username, sunsynk_password) as client:
        inverters = await client.get_inverters()
        for inverter in inverters:
            grid = await client.get_inverter_realtime_grid(inverter.sn)
            battery = await client.get_inverter_realtime_battery(inverter.sn)
            solar_pv = await client.get_inverter_realtime_input(inverter.sn)

            await client.get_inverter_realtime_output(inverter.sn)

            print(f"Inverter (sn: {inverter.sn}) is drawing {grid.get_power()}W from the grid, {battery.power}W from battery and {solar_pv.get_power()}W.")

    print('Done!')

asyncio.run(main())

Use With an Existing aiohttp Session

Pass a session to share an existing aiohttp.ClientSession. The client does not close a shared session:

async with aiohttp.ClientSession() as session:
    client = SunsynkClient(sunsynk_username, sunsynk_password, session=session)
    await client.login()
    inverters = await client.get_inverters()

Errors

All errors raised by the client subclass sunsynk.exceptions.SunsynkError:

  • SunsynkAuthenticationError - the username or password is not correct.
  • SunsynkConnectionError - the API could not be reached, timed out, or returned an unexpected response.

Numeric values in the API responses are converted to float or int. Values that are missing are None.

User

get_user returns the account that is logged in. user.id is a stable identifier for the account:

async with SunsynkClient(sunsynk_username, sunsynk_password) as client:
    user = await client.get_user()
    print(f"Logged in as {user.email} (id {user.id})")

Load, Plant Details and Weather

In addition to the inverter realtime data shown above, the client can also read the realtime load/UPS metrics, full plant details (including coordinates), and the weather for a plant's location:

async with SunsynkClient(sunsynk_username, sunsynk_password) as client:
    inverters = await client.get_inverters()
    load = await client.get_inverter_realtime_load(inverters[0].sn)
    print(f"Load is drawing {load.get_power()}W ({load.daily_used} kWh used today)")

    # get_plant returns the full plant detail, including lon/lat coordinates
    plant = await client.get_plant(inverters[0].plant.id)

    # The Sunsynk weather endpoint expects the coordinates as "lat,lon"
    weather = await client.get_weather(f"{plant.lat},{plant.lon}")
    print(f"It is currently {weather.get_current_temp()}C and {weather.description}")

get_weather defaults to today's date; pass date="YYYY-MM-DD" to request a specific day.

Metadata

Release files for sunsynk-api-client 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sunsynk-api-client 1.3.0
File Size Uploaded
sunsynk_api_client-1.3.0.tar.gz 12.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sunsynk-api-client 1.3.0
File Interpreter ABI Platform
sunsynk_api_client-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.4 kB

Release files / sunsynk_api_client-1.3.0.tar.gz

Download URL sunsynk_api_client-1.3.0.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2392f8c3ba2522f5551ffca066538914bb599cc021a36cd855406ced87a59cab
BLAKE2b-256 checksum
How to use checksums
28e193f08ad438f1155bdf4af1e4550084032d55510f24a0569d9e95852ba6f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release files / sunsynk_api_client-1.3.0-py3-none-any.whl

Download URL sunsynk_api_client-1.3.0-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8cd1ed547cb6a1c2770403454a21e3c401f3c30b38a012407d07b078d876e60
BLAKE2b-256 checksum
How to use checksums
e81b9b9c7a827f1ea45eee71fbc105e828397cd77bf123e6f0c552593af8ba30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release history Release notifications | RSS feed

1.4.0

2 release files

This release

1.3.0 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page