- Connect to the Interhuman video streaming API over WebSocket
- Send continuous video segments from a client
- Receive structured, segment-by-segment social-intelligence signals in real time
You’ll need an API key. Follow the API key guide for details.You’ll also need a client that can send binary video data, such as a browser
MediaRecorder producing WebM segments.1. Connect to the WebSocket endpoint
Use a persistent WebSocket connection to send segments and receive results as soon as each one is processed. Connect to:Connect to the API
Open a WebSocket and log server messages as they arrive.2. Send video segments
Send each message as a binary-encoded WebM segment. The endpoint expects short video chunks recorded by the browser’s MediaRecorder and rejects segments smaller than 10 KB or larger than 20 MB. A common approach:- Use MediaRecorder.
- Set a fixed timeslice (e.g. 5000 ms) so each segment is ~5 seconds.
- Ensure each chunk is at least 10 KB and no more than 20 MB.
- Convert each event into an
ArrayBufferand send it as binary.
Send segments from your client
Capture short WebM chunks on the client and push each one over the open WebSocket.3. Receive real-time results
The server sends three message types per segment:{"status": "processing", "segment": <number>}as soon as a chunk is received.- A
resultpayload with detected social signals for that segment. {"status": "completed", "segment": <number>}when processing finishes.
{"status": "error", "segment": <number>, "error": "<message>"}.
Signal type values you may receive: Agreement, Confidence, Confusion, Disagreement, Disengagement, Engagement, Frustration, Hesitation, Interest, Skepticism, Stress, Uncertainty.
Result message
Summary
- Open a WebSocket connection to the streaming endpoint.
- Continuously send video segments as binary WebM chunks.
- Handle
processing,result, andcompletedmessages for each segment; inspectdata.signalfor detected social signals. - Configuration (prompts, sampling, thinking) is applied server-side; no query parameters are required.