Sunsynk API Client
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.
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.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sunsynk_api_client-1.2.1.tar.gz | 12.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sunsynk_api_client-1.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.4 kB
Release files / sunsynk_api_client-1.2.1.tar.gz
| Download URL | sunsynk_api_client-1.2.1.tar.gz |
|---|---|
| Size | 12.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5523bb3bf0be54ee9a95c09a4a3c82a184dd20b6c898086a0dbfdb59970704ca
|
|
BLAKE2b-256 checksum How to use checksums |
bc464a20f26cd1152c4ff7156e73d800d1fae46cc9d9fa90125ee68945b641d6
|
| 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 logRelease files / sunsynk_api_client-1.2.1-py3-none-any.whl
| Download URL | sunsynk_api_client-1.2.1-py3-none-any.whl |
|---|---|
| Size | 13.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35579205eedd28ab657c91a77e1f2221e065a22f395e30ae5f64b0718f62baf3
|
|
BLAKE2b-256 checksum How to use checksums |
b60c9cfb5d9725b4d15cf596023359e80fd2c7ea108a8800761289be5c034da1
|
| 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