๐Ÿš€ Quick Start

Get up and running with the rPPG API in under 5 minutes.

๐Ÿš€ Quick Start

Get up and running with the rPPG API in under 5 minutes.

Installation

Install the SDK via npm:

npm install rppg-api-client

Or with yarn:

yarn add rppg-api-client

Basic Usage

Here's the fastest way to analyze a video and get vital signs:

import { RPPGClient } from 'rppg-api-client';

// Initialize the client
const client = new RPPGClient({
  apiKey: 'your-api-key-here',
  baseUrl: 'https://api.yourdomain.com/api'
});

// Analyze a video file
async function analyzeVideo(videoFile) {
  try {
    // One-line video analysis with automatic polling
    const vitals = await client.analyzeVideo(videoFile);
    
    console.log('Heart Rate:', vitals.heart_rate, 'bpm');
    console.log('Respiratory Rate:', vitals.respiratory_rate, 'breaths/min');
    console.log('HRV:', vitals.hrv);
    
    return vitals;
  } catch (error) {
    console.error('Analysis failed:', error.message);
  }
}

// Use with a file from input
const fileInput = document.querySelector('input[type="file"]');
fileInput.addEventListener('change', async (e) => {
  const file = e.target.files[0];
  const results = await analyzeVideo(file);
});

What You'll Get

The analyzeVideo() method returns vital signs data:

{
  "session_id": "sess_20251026_abc123",
  "heart_rate": 72.5,
  "respiratory_rate": 16.2,
  "hrv": 45.3,
  "blood_pressure": null,
  "confidence": 0.89,
  "timestamp": "2025-10-26T12:34:56Z",
  "processing_time_ms": 32450
}

Video Requirements

For accurate results, ensure your video:

  • โœ… Shows face clearly (frontal view preferred)
  • โœ… Has good, consistent lighting
  • โœ… Is 10-30 seconds in duration
  • โœ… Subject remains relatively still
  • โœ… File size under 100MB
  • โœ… Format: MP4, WebM, MOV, or AVI

Next Steps

Need Help?

Have questions? Contact us at support@circadify.com