📊 Ignis API Documentation

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

Technology (principles, accuracy & FAQ)

Authentication & Access

☁️ Remote Cloud Service

Call the official Ignis cloud API directly; no server deployment required.

  • Endpoint: wss://health.yanshutech.com/ws/
  • Auth: API Key required
  • Key: Go to Settings > API Access Key
  • Billing: 1 credit per WebSocket connection (billed per connection, not per measurement — a single connection can run for a long time). A connection is billed once; connections last up to about 12 hours and must then be re-established, which is billed as a new connection.

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://YOUR_LOCAL_IP:9100
  • Auth: Optional (can be left empty for local testing, depending on configuration)
  • Note: Suited to scenarios with strict data-privacy requirements

URL format example

ws://{HOST}/ws/?token={API_KEY}

Available clients: the official web product (browser camera), the official Android app (APK), and WebSocket clients on any platform (frame streaming can be implemented on Linux / Windows / macOS / iOS / Android). White-labeling is offered via the WebSocket API and the Android app; there is no off-the-shelf native iOS/Android SDK — native SDKs are delivered per project.

Sample Code Downloads

The files below provide complete integration examples. Right-click a link and choose "Save as" to download.

FileTypeDescriptionAction
js_simple.html Web frontend Minimal HTML+JS client demonstrating camera capture and streaming View / Download
python_simple.py Python script Python example using OpenCV to capture and push a binary stream Download
rtsp_simple.html Web tool RTSP stream test console for sending start/stop commands View / Download
metrics.html Documentation Detailed mapping of physiological metrics and JSON fields View

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);

Response Data Dictionary

The server pushes analysis results in real time over WebSocket as JSON. 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.
SBP / DBPmmHgEstimated systolic / diastolic blood pressure (wellness estimate, not a cuff replacement).
Breathing_RATErpmRespiratory rate.

🧠 Psychological & Wellness

JSON pathDescription
emotion_short_resReal-time emotion trend. Enum values: Neutral, Happy, Sad, etc.
stress_scoreStress index (0-100), a trend 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.