📊 Ignis API Documentation

Integration guide for the rPPG-based real-time physiological monitoring service

Technology (principles, accuracy & FAQ)

1. Access & Authentication

☁️ Remote Cloud Service

Call the official cloud API directly; no deployment required.

  • Endpoint: wss://wuancheng.com:16443/ws/health
  • Auth: Authorization: Bearer <API Key>
  • Key: Settings > API Access Key
  • Billing: 1 credit per connection; up to ~12 hours per connection
Enterprise License & billing details

Enterprise License pricing is based on authorized terminals/instances within the contracted scope, separate from self-service Cloud API credits per connection. A 100,000 completed scans package can also be negotiated separately; the contract must define completed scans, failed/retried scans, validity and pricing. One connection does not equal one measurement. Contact wuac@yanshutech.com.

🏠 Self-hosted / Local Deployment

Run inside your own intranet server or Docker container.

  • Endpoint: ws://127.0.0.1:9100 (server host; enable listener/port mapping for remote)
  • Auth: Authorization: Bearer <business-token>
  • Deployment, token & troubleshooting: see the table and integration notes

Credentials

ScenarioCredentialTransportSource / Notes
CloudAPI KeyAuthorization: BearerConsole > API Access Key
Self-hosted / localbusiness-tokenAuthorization: BearerHost /var/lib/emotion_hr/installations/emotion_hr/security/business-token; Docker /license-state/business-token (path depends on deployment)
Self-hosted short-lived (optional)ehr1 (1–300 s)Authorization: BearerGateway issues it from the business-token; renew after expiry; never distribute the long-lived token
Share link (web)guest_share JWTURL query ?token=Generated by “Live monitoring share” in the console as guest_monitor.html?token=...; 1 hour, single use, charged to the sharer; cloud guest only, not accepted by self-hosted 9100

2. Core Protocols

The client (browser / Python / Android) captures camera frames and sends frame data to the server over WebSocket as binary messages.

Binary Packet Structure

Byte offsetData typeEndiannessDescription
Byte 0Uint8-Type flag (fixed to 0, indicating a video frame)
Byte 1-8Float64Little EndianTimestamp (in seconds, double precision)
Byte 9...Bytes-JPEG image data (complete file stream)

Code samples

Python (OpenCV + struct)

import struct
import time
import cv2

# 1. Compress the frame
_, jpeg = cv2.imencode('.jpg', frame, [int(cv2.IMWRITE_JPEG_QUALITY), 90])

# 2. Build the header: Type(0) + Timestamp(double)
# < means little-endian, B=uchar, d=double
header = struct.pack('<Bd', 0, time.time())

# 3. Send
ws.send(header + jpeg.tobytes(), opcode=2)

JavaScript (Browser)

// Assume jpegBuffer is an image ArrayBuffer
const timestamp = Date.now() / 1000;
const totalLen = 1 + 8 + jpegBuffer.byteLength;
const buffer = new ArrayBuffer(totalLen);
const view = new DataView(buffer);

// 1. Write type and timestamp (true = little-endian)
view.setUint8(0, 0); 
view.setFloat64(1, timestamp, true);

// 2. Write image data
new Uint8Array(buffer, 9).set(new Uint8Array(jpegBuffer));

ws.send(buffer);

3. Response Data Dictionary

The server pushes analysis results over WebSocket every 30 frames (about 1 second) as JSON. hrv is null while warming up. The structure is as follows:

For detailed metric definitions, see metrics.html

🩺 Physiological (main fields)

JSON pathUnitDescription
spo2%Blood oxygen saturation (estimate). If it stays below 95%, re-measure with a medical device and consult a doctor.
hrv.meanHrbpmMean heart rate.
hrv.sdnnmsSDNN (Standard Deviation of NN intervals).
hrv.rmssdmsRMSSD. Mainly reflects parasympathetic activity.
hrv.SBP / hrv.DBPmmHgEstimated systolic / diastolic blood pressure (wellness estimate, not a cuff replacement).
hrv.Breathing_RATErpmRespiratory rate.

🧠 Psychological & Wellness

JSON pathDescription
emotion_short_resEmotion distribution: an object mapping Chinese labels (e.g. 中性, 快乐, 伤心) to probabilities; only entries > 0.05 are kept. May be null while warming up.
hrv.mood_score.stress_scoreStress index (0-100), a trend score.
hrv.mood_score.attention_scoreAttention trend score.
Wellness reference only: All listed metrics are algorithm estimates, not diagnoses or psychological assessments. Experimental / Research Fields are excluded from this commercial dictionary and from standard commercial feature commitments. Research use and any project-specific delivery require a separate written agreement. For health concerns, consult a qualified physician.

4. Examples & Docs

Right-click and choose "Save as" to download; documentation opens in the browser.

Integration docs

FileDescriptionAction
integration.html9100 ingress, business-token / ehr1, binary frames and error codesView
metrics.htmlFull field reference (including research fields)View

Sample code

FileTypeDescriptionAction
js_simple.htmlWeb frontendBrowser camera streaming (token in query; gateway required in strict mode)View / Download
python_simple.pyPythonOpenCV capture and binary frame streaming (Authorization header)Download
rtsp_simple.htmlWeb toolRTSP start/stop console (uses the server-returned stream_id)View / Download

Available clients: the official web product, the official Android app, and WebSocket clients on any platform. White-labeling is offered via the WebSocket API and Android app; native SDKs are delivered per project.

衍数科技 · 产品与使用指南 / Yanshu products