Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.hoplynk.com/llms.txt

Use this file to discover all available pages before exploring further.

Install

pip install hoplynk
The package requires Python 3.10+.

Initialize

import os
from hoplynk import HoplynkClient

client = HoplynkClient(api_key=os.environ["HOPLYNK_API_KEY"])

Kits

# List all kits
kits = client.get_kits()
kit_id = kits[0]["id"]

# Full telemetry snapshot
data = client.get_kit_telemetry(kit_id)

# GPS
loc = client.get_kit_location(kit_id)
print(loc.lat, loc.lon, loc.source)

# Battery
battery = client.get_battery(kit_id)
print(battery["level"], battery["charging"])

# Gateway
gateway = client.get_gateway(kit_id)
print(gateway["model"], gateway["cpu_pct"])

# Connected clients
clients = client.get_clients(kit_id)

# Speedtest
speedtest = client.get_speedtest(kit_id)

# All WAN links
links = client.get_links(kit_id)
for link in links:
    print(link.name, link.type, link.status, link.latency_ms)

# Single link by type
cellular = client.get_link(kit_id, "cellular")
starlink  = client.get_link(kit_id, "starlink")

Assets

# List all assets
assets = client.get_assets(kit_id)

# Single asset
asset = client.get_asset(kit_id, asset_id)

# Asset telemetry
snap = client.get_telemetry(kit_id, asset_id)
if snap.gps:
    print(snap.gps.lat, snap.gps.lon)

Streaming

# Kit-level stream (GPS, Starlink)
with client.kit_stream(kit_id, feeds=["gps", "starlink"]) as stream:
    for event in stream:
        print(event["feed"], event["payload"])

# Asset-level stream (drone GPS, attitude)
with client.stream(kit_id, asset_id, feeds=["gps", "attitude"]) as stream:
    for event in stream:
        print(event["feed"], event["payload"])

Reference

MethodReturnsDescription
get_kits()list[dict]All kits for this API key
get_kit_telemetry(kit_id)dictFull telemetry snapshot
get_kit_location(kit_id)GpsPayloadStarlink GPS fix
get_battery(kit_id)dictBattery level + charging state
get_gateway(kit_id)dictUniFi gateway info
get_clients(kit_id)list[dict]Connected devices
get_speedtest(kit_id)dictLast speedtest result
get_links(kit_id)list[LinkStatus]All WAN links
get_link(kit_id, name)LinkStatusSingle link by name/type
get_assets(kit_id)list[dict]All assets
get_asset(kit_id, asset_id)dictSingle asset
get_telemetry(kit_id, asset_id)TelemetrySnapshotAsset feeds
kit_stream(kit_id, feeds=[])HoplynkStreamKit-level WS stream
stream(kit_id, asset_id, feeds=[])HoplynkStreamAsset-level WS stream