Skip to main content

landbook-api

Unofficial Python client for the Landbook smart home cloud API (Netprisma/Landecia), reverse-engineered from the Landbook iOS app. Covers:

  • REST: email/password login, token refresh, device discovery, TSL (Thing Specification Language) model fetch, device attribute reads.
  • MQTT: a persistent WebSocket/TLS pub-sub connection for real-time device control and state (LandbookMQTTClient).
  • Local LAN control: a direct TCP connection to a device on the local network, bypassing the cloud entirely (LandbookLocalClient) — see LOCAL_CONTROL.md.

This library powers the landbook-ha Home Assistant integration, but has no dependency on Home Assistant and can be used standalone.

Installation

pip install landbook-api

Usage

from landbook_api import login, get_device_list, get_tsl, LandbookMQTTClient

bearer_token, uid, refresh_token = login("you@example.com", "your-password", region="us")

devices = get_device_list(bearer_token, region="us")
pk = devices[0]["productKey"]
dk = devices[0]["deviceKey"]

properties = get_tsl(bearer_token, pk, region="us")

client = LandbookMQTTClient(uid, bearer_token)
client.connect()


def on_message(topic_suffix: str, payload: dict) -> None:
    print(topic_suffix, payload)


device_id = f"qd{pk}{dk}"
client.subscribe_device(device_id, on_message)
client.send_read(device_id, pk, dk, [p["code"] for p in properties])

Async equivalents (async_login, async_get_device_list, async_get_tsl, async_refresh_token, async_get_device_attributes) are also exported — each wraps the sync call in a thread executor.

Supported Regions

Region API
United States iot-api.quectelus.com
Europe iot-api.quecteleu.com
China iot-gateway.quectel.com

Pass region="us", "eu", or "cn" to any call (defaults to "us"). EU and CN are untested — reports welcome via issues.

Session Tokens

login() returns a (bearer_token, uid, refresh_token) tuple. The access token (bearer_token) is valid for 2 hours; the refresh token is valid for 30 days and must be used to obtain a new pair via refresh_token() before the access token expires. Both values should be persisted by the caller — this library does not manage token storage.

Development

pip install -e ".[test]"
pytest

Disclaimer

This is an unofficial, reverse-engineered client with no affiliation to Landbook, Netprisma, or Landecia. It may break if the upstream API changes.

Release files for landbook-api 0.7.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 landbook-api 0.7.0
File Size Uploaded
landbook_api-0.7.0.tar.gz 42.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for landbook-api 0.7.0
File Interpreter ABI Platform
landbook_api-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 65.6 kB

Release files / landbook_api-0.7.0.tar.gz

Download URL landbook_api-0.7.0.tar.gz
Size 42.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9a6e1d09a12316fc8fbc9fd455bab68be28d2b2cb058c1a81a24c893f3c19477
BLAKE2b-256 checksum
How to use checksums
31bfdbdfdfb330cbd880aef13521e891228e8af746592859f4d4cd8373e83738
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 Sep 22, 2026.

Transparency log

Release files / landbook_api-0.7.0-py3-none-any.whl

Download URL landbook_api-0.7.0-py3-none-any.whl
Size 23.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35658e5a8f88351b0a4f71891879223f0afafaafac0c97f9a9f4571962f80462
BLAKE2b-256 checksum
How to use checksums
8d14994ee5744d283766f3789c505b8d7bc848f26de317ea6187bf353725564c
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 Sep 22, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.0

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

This release

0.7.0 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

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