Creality K1 API
A Python package to communicate with the Creality K1 / K1 Max 3D printer over WebSocket.
Installation
pip install creality_k1_api
Usage
Basic Connection
The client is asynchronous and handles connection management, heartbeats, and message processing. You must provide a callback function that will receive parsed JSON updates from the printer.
import asyncio
from creality_k1_api import CrealityK1Client
def on_new_data(data: dict):
# Handle incoming telemetry updates (temperature, status, progress, etc.)
print("Received update:", list(data.keys()))
async def main():
# K1 WebSocket uses port 9999 by default
client = CrealityK1Client("ws://192.168.10.161:9999", on_new_data)
await client.connect()
# Listen to live updates for 10 seconds
await asyncio.sleep(10)
await client.disconnect()
if __name__ == "__main__":
asyncio.run(main())
Retrieving Timelapse Videos
You can fetch the list of recorded timelapse videos from the printer. The client dynamically parses the printer's hostname to construct complete HTTP download links, and extracts the print start time from the video filename.
import asyncio
from creality_k1_api import CrealityK1Client
async def main():
client = CrealityK1Client("ws://192.168.10.161:9999", lambda data: None)
await client.connect()
if client.is_connected:
# Fetch the list of timelapses (with a 5-second timeout)
videos = await client.get_timelapses(timeout=5.0)
print(f"Found {len(videos)} timelapse videos:")
for video in videos:
print(f"Gcode: {video['gcode']}")
print(f"Download: {video['url']}")
print(f"Start Time: {video.get('start_time')} (UTC)")
print("-" * 50)
await client.disconnect()
if __name__ == "__main__":
asyncio.run(main())
Each timelapse item in the returned list contains:
gcode: The name of the Gcode file that was printed (e.g.Cover_PLA.gcode).url: The full HTTP download URL for the.mp4video (e.g.http://192.168.10.161/downloads/video/1764698892.mp4).timestamp: The Unix timestamp when the print job started (extracted from the filename, e.g.1764698892).start_time: The ISO-8601 UTC formatted datetime representation of the start time (e.g.2025-12-02T18:08:12+00:00).
Metadata
Release files for creality-k1-api 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| creality_k1_api-0.0.3.tar.gz | 19.6 kB | Without provenance | Details for creality_k1_api-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| creality_k1_api-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for creality_k1_api-0.0.3-py3-none-any.whl |
Total release size: 37.7 kB
Release files / creality_k1_api-0.0.3.tar.gz
| Download URL | creality_k1_api-0.0.3.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6e3bdbdcb25e5093900318fa190a7f7b2d6b8652d5ef8ebe72f056b47296910a
|
|
BLAKE2b-256 checksum How to use checksums |
6c96d7f767268a62ee29fa06d5730514cfbfd850fd6aa72712275dd0ba205e1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / creality_k1_api-0.0.3-py3-none-any.whl
| Download URL | creality_k1_api-0.0.3-py3-none-any.whl |
|---|---|
| Size | 18.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
72820a08cfa8117cdaeabc43eb50a312ff936337990bd6d65edc3cef5e8a1388
|
|
BLAKE2b-256 checksum How to use checksums |
fb038bdd19863f49e20dd244c593f1beadc840fe3a6a228c485c30885e1f9a28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for creality-k1-api 0.0.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.