EQ Coherence API Reference
EQ Coherence exposes REST and WebSocket APIs for programmatic access to power quality data. All API endpoints are served from the gateway.
Access Paths
There are two ways to reach a gateway’s API, and they use different hosts and ports. Choose based on where your client runs.
| Path | When to use | Base host | Port | Auth |
|---|---|---|---|---|
| LAN (direct) | Client is on the same network as the gateway | Gateway’s local IP (e.g. 192.168.1.100) | 8080 | None (local network) |
| WAN (remote) | Client is off-site | eqg-{serial}.pq.app | standard 443 (https/wss, no port suffix) | Required (login session) |
Notes:
- Port
8080is the gateway’s direct backend port. It is reachable only over the LAN, on the gateway’s own IP. It is not exposed on theeqg-*.pq.appaddress. Do not append:8080to apq.apphost. - The WAN path routes through Cloudflare to the gateway and is protected by single sign-on (CF Access / Keycloak). Remote requests must carry a valid login session, so this path is easiest from a browser-authenticated context. For quick one-off scripting, prefer the LAN path.
The endpoint paths (/api/v1/..., /api/ws/...) are identical on both. Only the host and port differ.
Integration Methods
| Method | Description |
|---|---|
| EQ Sight | Browser-based real-time visualization and event monitoring |
| equser Python package | Data loading, live acquisition, and API client |
| REST API | HTTP-based queries for stored data (see below) |
| WebSocket | Live waveform and spectral streaming (see below) |
| Direct sensor access | TCP socket connections to EQ Wave sensor (advanced) |
Additional protocol support (Modbus TCP, MQTT, DNP3) is available upon request for SCADA/BMS integration. Contact [email protected] for details.
REST API
Base URL (LAN): http://[gateway-ip]:8080/api/v1/
Base URL (WAN): https://eqg-{serial}.pq.app/api/v1/
Data query parameters: start_time (ISO 8601), end_time (ISO 8601), metrics (comma-separated), limit.
Data endpoints return Apache Arrow IPC binary format for efficient transfer. Use Arrow libraries in Python, JavaScript, Rust, or other languages to deserialize.
Device Endpoints
| Endpoint | Method | Description | Response |
|---|---|---|---|
/devices | GET | List registered devices | JSON |
/devices/{id} | GET | Device details (paths, capabilities) | JSON |
Data Endpoints
| Endpoint | Method | Description | Response |
|---|---|---|---|
/devices/{id}/pmon/data | GET | Power monitoring data | Arrow IPC |
/devices/{id}/cpow/data | GET | Continuous waveform data | Arrow IPC |
/devices/{id}/thumbnail | POST | Metric thumbnail for charting | Arrow IPC |
/query/sql | POST | SQL queries (SELECT only, default limit 30) | Arrow IPC |
Event Endpoints
| Endpoint | Method | Description | Response |
|---|---|---|---|
/events | GET | List power quality events | JSON |
/events/{id} | GET | Event details | JSON |
/events/stream | GET | Real-time event notifications | SSE |
/events/today | GET | Events from today | JSON |
/events/last7days | GET | Events from past 7 days | JSON |
/events/last30days | GET | Events from past 30 days | JSON |
System Endpoints
| Endpoint | Method | Description | Response |
|---|---|---|---|
/system/hostname | GET | Gateway hostname | JSON |
/health | GET | Health check | JSON |
Example: Python with Arrow
import pyarrow.ipc as ipc
import requests
# Fetch power monitoring data
url = "http://192.168.1.100:8080/api/v1/devices/wave-001/pmon/data"
resp = requests.get(url, params={"start_time": "2025-06-15T12:00:00Z"})
reader = ipc.open_stream(resp.content)
table = reader.read_all()
df = table.to_pandas()
WebSocket Endpoints
For live streaming data from EQ Coherence.
| Endpoint | Description | Format |
|---|---|---|
/api/ws/cpow_stream | Live CPOW waveform streaming | Arrow IPC batches |
/api/ws/spectral | Real-time spectral analysis (broadcast) | Arrow IPC windows |
Prefix with the host from the access path you are using:
- LAN:
ws://[gateway-ip]:8080/api/ws/cpow_stream - WAN:
wss://eqg-{serial}.pq.app/api/ws/cpow_stream
Spectral WebSocket parameters: channels (e.g. VA,IA), mode (cycle_aligned or fixed), cycles (default 12, cycle_aligned mode), fft_size (default 4096, fixed mode), freq_min (default 0), freq_max (default 3000), include_phase (default false). The stream is a broadcast consumer of the live CPOW feed (not per-device); each binary message is an Arrow IPC window with per-window metadata on the schema.
Custom Integration
For integration requirements beyond what is documented here, contact [email protected].