Skip to main content

NexBlue API

nexblue-api is the official asynchronous Python client for the NexBlue OpenAPI. It is maintained by NexBlue and currently provides the communication layer used by the NexBlue Home Assistant integration.

The package handles authentication, access-token refresh, charger discovery, charger telemetry, and start/stop charging commands. It is deliberately independent of Home Assistant so it can be reused by other Python applications.

Requirements

  • Python 3.13 or later
  • A NexBlue account with access to the NexBlue OpenAPI

Installing this library does not create, grant, or expand access to a NexBlue account or service.

Installation

pip install nexblue-api

Basic usage

Keep credentials outside source code. The example uses environment variables and a placeholder API base URL supplied by NexBlue.

import asyncio
import os

import aiohttp

from nexblue_api import NexBlueClient


async def main() -> None:
    async with aiohttp.ClientSession() as session:
        client = NexBlueClient(
            session,
            os.environ["NEXBLUE_API_BASE_URL"],
        )

        await client.async_login(
            os.environ["NEXBLUE_USERNAME"],
            os.environ["NEXBLUE_PASSWORD"],
        )

        for charger in await client.async_list_chargers():
            status = await client.async_get_charger_status(charger.serial_number)
            print(charger.serial_number, status.charging_state, status.power_kw)


asyncio.run(main())

Supported operations

  • End-user login and refresh-token based access-token renewal
  • Charger discovery
  • Charger status and telemetry retrieval
  • Start charging and stop charging commands
  • Typed charger, status, and token models
  • Safe exceptions for authentication, connection, rate-limit, offline-device, and rejected-command errors

Status values are normalized to the API's documented units: kW, kWh, A, and V. Charging commands can still be rejected by the API or charger, for example when the charger is offline or another user is controlling it.

Credential handling

Do not commit, log, or share usernames, passwords, access tokens, refresh tokens, or OAuth client credentials.

The client retains tokens only for its active lifetime. Applications that need to restore a session should persist only the refresh token using their platform's protected credential storage, then call async_refresh_access_token. Do not persist an end-user password merely to perform automatic logins.

This library does not embed NexBlue OAuth client credentials. Applications using an external OAuth flow may provide an externally managed access token with set_access_token.

Development

python -m pytest -q
python -m build
python -m twine check dist/*

Please report bugs through the repository issue tracker. Do not include credentials, tokens, full API responses, or personally identifiable charger information in issues.

License

Copyright 2026 NexBlue.

Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexblue_api-0.1.1.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexblue_api-0.1.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file nexblue_api-0.1.1.tar.gz.

File metadata

  • Download URL: nexblue_api-0.1.1.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nexblue_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f95bc606f67de9e8fcb8a2dbb1e0067ca3dd341ae93eb2ee5477b162b4ddfe75
MD5 3e47389dc4ed738d99ca7809f8f802ba
BLAKE2b-256 43b3843f758be69decbb387b332a39d51bb58b4dc9047480e8bd11d3890db96c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexblue_api-0.1.1.tar.gz:

Publisher: release.yml on NexBlue-AB/nexblue-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexblue_api-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: nexblue_api-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for nexblue_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf9feffb62034f61f3af56773e9be98aba25a135d70b448395027df3f1399690
MD5 2d1d05ed13d2f32aeb70a2bcc4151352
BLAKE2b-256 d7ba4062e1614688794c57d4176acf166eb7b1148dd4a86126927690ede2f843

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexblue_api-0.1.1-py3-none-any.whl:

Publisher: release.yml on NexBlue-AB/nexblue-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page