Skip to main content

united-utilities-py

Async Python client for the United Utilities "Your Water" mobile API, reverse-engineered from the app (build 102). Pairs with a Home Assistant integration (united-utilities-hass).

Unofficial. Uses a private app API that United Utilities can change or withdraw at any time. For personal use with your own account.

Why the mobile API (not the website)

The myaccount.unitedutilities.com website is gated behind Google reCAPTCHA Enterprise and Jscrambler, so a scripted login needs a real browser. The mobile app talks to a separate gateway (prd-mobile-apigateway.unitedutilities.com) with a far simpler scheme: a static app apiKey header plus a customerId + numeric PIN login that returns a session token. No captcha.

Credentials

The mobile API does not use your website email/password. It needs:

  • customerId — a numeric id assigned when you register in the app.
  • pin — the numeric PIN you set in the app.
  • accountNumber — your water account number (for account-scoped calls).

The app doesn't show customerId, but you can look it up from your account number and postcode, the same way the app's "register again" screen does. The account must already be registered in the app:

from united_utilities import lookup_customer_id

customer_id = await lookup_customer_id("4000000000", "M1 1AA")

⚠️ Login and lookup both lock out. A wrong PIN decrements attemptsRemaining; at zero the account locks (HTTP 423, raised as AccountLockedError, which the app says lasts 60 minutes). This client never retries login() or lookup_customer_id(). Do not loop on AuthError.

Install

pip install united-utilities

Usage

import asyncio
from united_utilities import UnitedUtilitiesClient


async def main() -> None:
    async with UnitedUtilitiesClient("24000000", "000000", "4000000000") as uu:
        await uu.login()
        details = await uu.account_details()
        meter = await uu.meter_readings()
        print("balance:", details.account_balance)
        if meter.latest:
            print("last read:", meter.latest.value, "on", meter.latest.date)


asyncio.run(main())

In Home Assistant, pass the shared session:

from homeassistant.helpers.aiohttp_client import async_get_clientsession

client = UnitedUtilitiesClient(customer_id, pin, account_number,
                               session=async_get_clientsession(hass))

Endpoints covered

Method Returns
lookup_customer_id(account_number, postcode) the app customerId (module function, no login needed)
login() / logout() session token lifecycle
account_details() balance, next payment, meter flag, payment plan, bill count
meter_readings() meter details + reading history (.latest)
statement() itemised bills & payments
payment_info() current balance, minimum payment
preferences() notification preferences
notifications() customer notifications

Development

See CONTRIBUTING.md. Response shapes were confirmed against live production responses; tests run on synthetic fixtures (no real account data) with aresponses.

License

MIT

Metadata

Release files for united-utilities 0.3.1

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

Source distribution (sdist)

Source distribution for united-utilities 0.3.1
File Size Uploaded Provenance Actions
united_utilities-0.3.1.tar.gz 14.0 kB With provenance Details for united_utilities-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for united-utilities 0.3.1
File Interpreter ABI Platform Actions
united_utilities-0.3.1-py3-none-any.whl Python 3 none any Details for united_utilities-0.3.1-py3-none-any.whl

Total release size: 25.3 kB

Release files / united_utilities-0.3.1.tar.gz

Download URL united_utilities-0.3.1.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
54bcae6031741cda392b4606d368859e9ada5c7d05d3f38f8854465fc0454e22
BLAKE2b-256 checksum
How to use checksums
9bf6172e1108e260e4b995cdebc43d358bccbd2d7251b3d05b529ccb4c9bafae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Release files / united_utilities-0.3.1-py3-none-any.whl

Download URL united_utilities-0.3.1-py3-none-any.whl
Size 11.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13c07776842a9cb8d2e5157b2f13d75b3f7d5d8578ae8df44931eb0d99fd1ae4
BLAKE2b-256 checksum
How to use checksums
baa899b260b8342b30e9e801ba4f161d3f59385358f6e2f9d2161f71b074b741
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 23, 2026.

Transparency log

Security for united-utilities 0.3.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for united_utilities-0.3.1.tar.gz

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 Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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