Skip to content

Query scan results

Once patients complete their scans, you can retrieve the results programmatically to display in your own app, sync to a health record, or trigger follow-up workflows.

  1. Fetch the most recent scans across all patients. The response includes a meta.totalCount field for pagination.

    const { data: scans, meta } =
    await client.v1.vitals.scans.list({ limit: 20 })
    console.log(`${meta.totalCount} total scans`)
    for (const scan of scans) {
    console.log(scan.id, scan.status, scan.createdAt)
    }

    Scans have one of these statuses: PENDING, STARTED, SUCCEEDED, FAILED, or ABORTED.

  2. Fetch the full details of a scan by its ID:

    const { data: scan } =
    await client.v1.vitals.scans.retrieve('scan-id')
  3. Completed scans (SUCCEEDED) include a results object with the measured vitals:

    if (scan.status === 'SUCCEEDED' && scan.results) {
    const { metrics } = scan.results
    console.log(metrics.heartRate)
    console.log(metrics.bloodPressureSystolic)
    console.log(metrics.bloodPressureDiastolic)
    console.log(metrics.breathingRate)
    console.log(metrics.stressIndex)
    console.log(metrics.wellnessScore)
    }

    The metrics included in results depend on the scan template configuration. Common metrics include heartRate, heartRateVariability, breathingRate, stressIndex, bloodPressureSystolic, bloodPressureDiastolic, wellnessScore, vascularAge, bodyFatPercentage, and basalMetabolicRate. Any metric not measured in a scan will be null.