API Documentation

v1.0.0 Live

Getting Started

The SmartScanPro.ai API is a powerful medical device data extraction service that uses advanced AI to process images of medical devices and extract actionable data in JSON format.

Base URL

https://api.smartscanpro.ai

Quick Setup

  1. Register for an account at register.html
  2. Create a project in the dashboard
  3. Get your API key from the dashboard
  4. Start making API calls with your key

Minimum Requirements

  • Image Format: JPEG, PNG, GIF, WebP
  • Image Size: Maximum 10MB
  • Authentication: API key required
  • Content Type: multipart/form-data
Ready to start? Check out our code examples for quick implementation.

Authentication

The SmartScanPro.ai API uses API key authentication for all requests.

API Key Authentication

Include your API key in the request headers:

X-API-Key: dk_your_api_key_here

Or as a query parameter:

https://api.smartscanpro.ai/v1/extract-medical-data?api_key=dk_your_api_key_here

Getting Your API Key

  1. Register at register.html
  2. Login to your dashboard at dashboard.html
  3. Navigate to "API Keys" section
  4. Generate a new API key
  5. Copy and securely store your key
Security Note: Keep your API keys secure and never expose them in client-side code.

API Endpoints

Medical Data Extraction

POST /api/v1/extract-medical-data

Extract medical device data from images using advanced AI.

Headers:
X-API-Key: dk_your_api_key_here
Content-Type: multipart/form-data
Parameters:
  • image (file, required): Medical device image
  • device_type (string, optional): Device type hint
  • confidence_threshold (number, optional): Minimum confidence (0.0-1.0)

Device Information

GET /api/device-types

Get list of supported device types.

Health Check

GET /api/health

Check API health status.

Dashboard API Endpoints

User Management
  • GET /api/auth/profile
  • PUT /api/auth/profile
Projects
  • GET /api/projects
  • POST /api/projects
  • GET /api/projects/:id
Usage Analytics
  • GET /api/dashboard/stats
  • GET /api/usage/analytics
  • GET /api/usage/logs
API Keys
  • GET /api/api-keys
  • POST /api/api-keys/generate

Supported Devices & Documents

The SmartScanPro.ai API supports 15 different types of medical devices and documents:

Medical Devices (12 Types)

Blood Pressure Monitors

Device Type: blood-pressure

Extracted Data:

  • Systolic pressure (top number, mmHg)
  • Diastolic pressure (bottom number, mmHg)
  • Pulse rate (PR/PULSE, BPM)
  • Mean arterial pressure (if calculated)
  • Pulse pressure (if calculated)
  • Measurement timestamp
  • Battery status/indicators
  • Memory readings (if displayed)
  • User profile (if multi-user device)
  • Irregular heartbeat indicators
  • Cuff pressure indicators
  • Error codes or warnings

Supported Brands: Omron, Withings, A&D Medical, Beurer, Generic monitors

Digital Scales

Device Type: scale

Extracted Data:

  • Weight measurement (kg, lb, lbs, st, oz)
  • BMI calculation (if height programmed)
  • Body fat percentage (%)
  • Muscle mass (kg, lbs)
  • Bone mass (kg, lbs)
  • Water percentage (%)
  • Visceral fat rating
  • Metabolic age
  • Protein percentage
  • Basal metabolic rate (BMR)
  • User profile/memory slot
  • Measurement timestamp
  • Battery indicators
  • Trend indicators (up/down arrows)

Supported Brands: Withings, Fitbit Aria, Tanita, Renpho, Eufy, Generic smart scales

Glucose Meters

Device Type: glucose-meter

Extracted Data:

  • Blood glucose level (main reading)
  • Unit (mg/dL, mmol/L)
  • Measurement date and time
  • Test strip lot number
  • Control solution results (if visible)
  • Memory readings/averages (7-day, 14-day, 30-day)
  • Before/after meal indicators
  • High/low glucose alerts
  • Ketone readings (if meter supports)
  • Temperature compensation
  • Battery level indicators
  • Error codes or messages
  • User ID (if multi-user)
  • Alternate site testing indicators

Supported Brands: Accu-Chek, OneTouch, FreeStyle, Contour, Bayer, Generic meters

Pulse Oximeters

Device Type: pulse-oximeter

Extracted Data:

  • Oxygen saturation (SpO2 percentage)
  • Pulse rate (PR/pulse, BPM)
  • Perfusion index (PI)
  • Plethysmographic waveform quality
  • Signal strength indicators
  • Low perfusion alerts
  • Motion artifact detection
  • Pulse amplitude
  • Measurement timestamp
  • Battery level indicators
  • Sensor off/probe off alerts
  • Adult/pediatric/neonatal mode
  • Alarm limits (high/low SpO2, pulse)
  • Trend data (if displayed)

Supported Brands: Masimo, Nonin, Contec, Zacurate, Innovo, Generic oximeters

Digital Thermometers

Device Type: thermometer

Extracted Data:

  • Body temperature value
  • Unit (°C, °F)
  • Measurement location (oral, rectal, axillary, forehead, ear)
  • Fever indicators/alerts
  • Normal temperature range indicators
  • Age-specific fever thresholds
  • Memory readings (last measurement)
  • Measurement timestamp
  • Battery level indicators
  • Probe cover detection
  • Environmental temperature compensation
  • Error codes (probe error, ambient temp, etc.)
  • Calibration status
  • Auto-shutoff indicators

Supported Brands: Braun, Omron, iHealth, Kinsa, Vicks, Generic digital thermometers

Peak Flow Meters

Device Type: peak-flow-meter

Extracted Data:

  • Peak expiratory flow rate (PEFR in L/min)
  • Personal best percentage (if displayed)
  • Zone indicators (green/yellow/red traffic light)
  • Age/height predicted values
  • Previous reading comparisons
  • Average readings (daily, weekly)
  • Measurement timestamp
  • Patient age/height settings
  • Medication timing indicators
  • Asthma action plan zone
  • Memory storage indicators
  • Low flow alerts
  • Calibration status
  • Unit settings (L/min, L/sec)

Supported Brands: Clement Clarke, Respironics, Omron, Vitalograph, Microlife

ECG Monitors

Device Type: ecg-monitor

Extracted Data:

  • Heart rate (HR or BPM)
  • Rhythm classification (normal sinus, atrial fibrillation, etc.)
  • QT/QTc intervals (if displayed)
  • Lead configuration (Lead I, II, III, aVR, aVL, aVF)
  • P-wave analysis
  • QRS complex duration
  • ST segment analysis
  • T-wave morphology
  • Arrhythmia detection
  • Heart rate variability (HRV)
  • Measurement timestamp
  • Recording duration
  • Signal quality indicators
  • Battery status
  • Electrode contact status
  • Artifact detection

Supported Brands: AliveCor, Omron HeartScan, EMAY, CheckMe, Wellue, Generic portable ECGs

Vaccine Certificates

Device Type: vaccine-certificate

Extracted Data:

  • Patient name and demographics
  • Date of birth or age
  • Vaccine name/type (specific vaccine identification)
  • Vaccine manufacturer (Pfizer, Moderna, etc.)
  • Vaccination date(s)
  • Lot number/batch number
  • Healthcare provider/clinic name
  • Administrator name (who gave vaccine)
  • Next due date (if applicable)
  • Dose number (1st, 2nd, 3rd, booster, annual)
  • Route of administration (IM, oral, nasal)
  • Site of injection (left/right arm, thigh)
  • Expiration date of vaccine
  • VIS (Vaccine Information Statement) date
  • Patient consent indicators

Supported Types: COVID-19, Influenza, Hepatitis, MMR, Travel vaccines, Childhood immunizations, ALL vaccine types

Dialysis Machines

Device Type: dialysis-machine

Extracted Data:

  • Treatment time (hours:minutes)
  • Ultrafiltration rate (UF rate in mL/hr or L/hr)
  • Blood flow rate (QB in mL/min)
  • Dialysate flow rate (QD in mL/min)
  • Transmembrane pressure (TMP in mmHg)
  • Venous pressure (VP in mmHg)
  • Arterial pressure (AP in mmHg)
  • Fluid removal goal (in L or mL)
  • Kt/V ratio (dialysis adequacy)
  • Treatment status (running, paused, complete)
  • Total fluid removed
  • Conductivity readings
  • Temperature settings
  • Heparin dosing (if displayed)
  • Access pressure monitoring
  • Alarm status and alerts
  • Patient dry weight
  • Session start/end times

Supported Brands: Fresenius, Baxter, B. Braun, Nipro, Gambro, Generic dialysis equipment

Pregnancy Test Kits

Device Type: pregnancy-kit

Extracted Data:

  • Test result (positive, negative, invalid)
  • Test type (digital, strip, cassette)
  • Control line status (visible, not visible, faint)
  • Test line intensity/visibility (faint, strong, clear)
  • Test date/time (if visible on device)
  • Brand name and model
  • Weeks indicator (if digital test shows weeks since conception)
  • Error codes or messages
  • Test validity indicators
  • Lot number/batch information
  • Expiration date
  • Test timing (minutes to read)
  • Sample type indicators
  • Sensitivity level (mIU/mL)

Supported Types: Digital tests, strip tests, cassette tests, early detection tests, all major brands

5-Parameter Monitors

Device Type: 5para-monitor

Extracted Data:

  • Heart rate (HR in bpm)
  • Blood pressure (systolic/diastolic in mmHg)
  • Oxygen saturation (SpO2 in %)
  • Respiratory rate (RR in breaths/min)
  • Body temperature (TEMP in °C or °F)
  • Mean arterial pressure (MAP in mmHg)
  • Pulse pressure (calculated)
  • Alarm indicators and alerts
  • Lead configuration (for ECG component)
  • Waveform quality indicators
  • NIBP (non-invasive blood pressure) cycle time
  • SpO2 sensor status
  • Temperature probe type
  • Patient information display
  • Trend data (if available)
  • Timestamp information
  • Device status and connectivity

Supported Brands: Philips, GE Healthcare, Mindray, Nihon Kohden, Masimo, Generic patient monitors

COVID Test Strips

Device Type: covid-test-strip

Extracted Data:

  • Test result (positive, negative, invalid, inconclusive)
  • Test type (rapid antigen, lateral flow, PCR, etc.)
  • Brand/manufacturer (Abbott, Quidel, BD, iHealth, etc.)
  • Control line status (visible, not visible, faint)
  • Test line status (visible, not visible, faint, strong)
  • Test date/time (if visible on device or packaging)
  • Lot number/batch number (if visible)
  • Expiration date (if visible)
  • Test window timing (e.g., "15 minutes")
  • Error codes or invalid result indicators
  • Sample type (nasal swab, saliva, etc.)
  • Sensitivity/specificity information (if visible)
  • Test kit serial number
  • Storage temperature indicators
  • QR codes or digital verification

Supported Types: Rapid antigen (BinaxNOW, FlowFlex, QuickVue), lateral flow, home test kits, professional tests

Medical Documents (3 Types)

Prescription Documents

Document Type: prescription

Extracted Data:

  • Patient information (name, DOB, address, phone)
  • Prescriber information (name, NPI, DEA number, address)
  • Pharmacy information (if pre-filled)
  • Date prescribed/written
  • Drug name (generic and brand names)
  • Strength/dosage (mg, ml, units, etc.)
  • Quantity prescribed
  • Directions for use/Sig (frequency, timing)
  • Number of refills allowed
  • Days supply
  • NDC number (if visible)
  • Diagnosis/indication (if mentioned)
  • Special instructions or notes
  • Controlled substance information
  • Generic substitution allowance (DAW codes)
Discharge Summaries

Document Type: discharge-summary

Extracted Data:

  • Patient demographics (name, DOB, MRN)
  • Admission/discharge dates
  • Admitting diagnosis and primary diagnosis
  • Secondary diagnoses and comorbidities
  • Procedures performed during stay
  • Hospital course summary
  • Discharge medications with instructions
  • New vs. continued medications
  • Follow-up appointments and instructions
  • Activity restrictions or recommendations
  • Diet instructions
  • Discharge disposition (home, rehab, SNF)
  • Attending physician and consultants
  • Vital signs at discharge
  • Lab values at discharge
  • Wound care instructions
  • Signs/symptoms to watch for
Clinical Notes

Document Type: clinical-notes

Extracted Data:

  • Patient information (name, DOB, MRN)
  • Date and time of visit/note
  • Provider information (physician, nurse, etc.)
  • Visit type (office visit, hospital round, consultation)
  • Chief complaint or reason for visit
  • History of Present Illness (HPI)
  • Review of Systems (ROS) findings
  • Physical examination findings
  • Vital signs (BP, HR, temp, RR, O2 sat, weight, height)
  • General appearance
  • System-specific findings (cardiac, pulmonary, etc.)
  • Assessment and Plan by diagnosis
  • Treatment plans
  • Medications prescribed or adjusted
  • Diagnostic tests ordered
  • Follow-up plans
  • Current medications list
  • Allergies
  • Social/family history updates
  • Immunizations given
Tip: For best results, ensure device displays are clearly visible and documents are well-lit and readable in your images.

Response Format

All API responses follow a consistent JSON format:

Success Response

{
  "success": true,
  "data": {
    "device_type": "blood-pressure",
    "confidence": 0.95,
    "extracted_data": {
      "systolic": 120,
      "diastolic": 80,
      "pulse": 72,
      "unit": "mmHg",
      "timestamp": "2024-01-15T10:30:00Z"
    },
    "processing_time_ms": 1250,
    "image_info": {
      "width": 1920,
      "height": 1080,
      "format": "JPEG",
      "size_bytes": 245760
    }
  }
}

Response Fields

  • success (boolean): Indicates if the request was successful
  • data (object): Contains the extracted information
    • device_type (string): Detected device type
    • confidence (float): AI confidence score (0.0-1.0)
    • extracted_data (object): Device-specific measurements
    • processing_time_ms (integer): Processing duration
    • image_info (object): Image metadata

Device-Specific Data Examples

Blood Pressure Monitor
{
  "systolic": 120,
  "diastolic": 80,
  "pulse": 72,
  "unit": "mmHg",
  "pulseUnit": "bpm",
  "meanArterialPressure": 93,
  "pulsePressure": 40,
  "timestamp": "2024-01-15T10:30:00Z",
  "batteryStatus": "normal",
  "irregularHeartbeat": false,
  "userProfile": 1,
  "memoryReading": false
}
Digital Scale
{
  "weight": 75.2,
  "unit": "kg",
  "bmi": 22.1,
  "bodyFatPercentage": 15.2,
  "muscleMass": 32.5,
  "boneMass": 3.2,
  "waterPercentage": 58.7,
  "visceralFatRating": 8,
  "metabolicAge": 28,
  "basalMetabolicRate": 1650,
  "userProfile": 2,
  "timestamp": "2024-01-15T07:00:00Z",
  "batteryLevel": "high",
  "trend": "stable"
}
Glucose Meter
{
  "glucoseLevel": 95,
  "unit": "mg/dL",
  "timestamp": "2024-01-15T08:15:00Z",
  "testStripLot": "ABC123",
  "mealIndicator": "before_meal",
  "averages": {
    "7day": 98,
    "14day": 102,
    "30day": 105
  },
  "highLowAlert": "normal",
  "batteryLevel": "good",
  "temperatureCompensation": true,
  "userId": 1,
  "memorySlot": 45
}
Pulse Oximeter
{
  "oxygenSaturation": 98,
  "pulse": 65,
  "perfusionIndex": 12.5,
  "signalStrength": "strong",
  "waveformQuality": "good",
  "lowPerfusionAlert": false,
  "motionArtifact": false,
  "pulseAmplitude": 2.8,
  "sensorStatus": "connected",
  "patientMode": "adult",
  "alarmLimits": {
    "spo2Low": 90,
    "spo2High": 100,
    "pulseLow": 50,
    "pulseHigh": 120
  },
  "timestamp": "2024-01-15T09:45:00Z",
  "batteryLevel": "medium"
}
Digital Thermometer
{
  "temperature": 36.8,
  "unit": "°C",
  "location": "oral",
  "feverIndicator": false,
  "normalRange": "36.1-37.2°C",
  "memoryReading": "last: 36.9°C",
  "timestamp": "2024-01-15T07:45:00Z",
  "batteryLevel": "good",
  "probeCover": "detected",
  "calibrationStatus": "valid",
  "environmentalCompensation": true,
  "autoShutoff": "2min"
}
Peak Flow Meter
{
  "peakFlowRate": 420,
  "unit": "L/min",
  "personalBest": 495,
  "personalBestPercentage": 85,
  "zone": "yellow",
  "predictedValue": 480,
  "previousReading": 435,
  "averageReadings": {
    "daily": 425,
    "weekly": 418
  },
  "patientAge": 35,
  "patientHeight": 175,
  "asthmaActionPlan": "yellow_zone",
  "timestamp": "2024-01-15T11:15:00Z",
  "calibrationDate": "2024-01-01"
}
ECG Monitor
{
  "heartRate": 68,
  "rhythm": "normal_sinus",
  "qtInterval": 380,
  "qtcInterval": 410,
  "leadConfig": "lead_I",
  "pWaveAnalysis": "normal",
  "qrsDuration": 95,
  "stSegment": "normal",
  "tWave": "normal",
  "arrhythmiaDetection": "none",
  "heartRateVariability": 45,
  "recordingDuration": "30s",
  "signalQuality": "excellent",
  "electrodeContact": "good",
  "artifactDetection": "minimal",
  "timestamp": "2024-01-15T12:30:00Z",
  "batteryStatus": "75%"
}
Vaccine Certificate
{
  "patientName": "John Doe",
  "dateOfBirth": "1985-03-15",
  "vaccineName": "COVID-19 mRNA Vaccine",
  "manufacturer": "Pfizer-BioNTech",
  "vaccinationDate": "2024-01-10",
  "lotNumber": "ABC123",
  "administrator": "Dr. Smith",
  "healthcareProvider": "City Medical Center",
  "doseNumber": 2,
  "routeOfAdministration": "intramuscular",
  "injectionSite": "left deltoid",
  "nextDueDate": "2024-07-10",
  "visDate": "2023-12-01",
  "vaccineExpiration": "2024-06-30"
}
Dialysis Machine
{
  "treatmentTime": "4:00",
  "bloodFlowRate": 350,
  "dialysateFlowRate": 500,
  "ultrafiltrationRate": 800,
  "transmembranePressure": 150,
  "venousPressure": 120,
  "arterialPressure": -80,
  "fluidRemovalGoal": 2.5,
  "ktVRatio": 1.4,
  "treatmentStatus": "running",
  "totalFluidRemoved": 1.8,
  "conductivity": 14.0,
  "temperature": 37.0,
  "patientDryWeight": 72.7,
  "sessionStartTime": "08:00",
  "accessPressure": 165,
  "alarmStatus": "none"
}
Pregnancy Test Kit
{
  "testResult": "positive",
  "testType": "digital",
  "weeksIndicator": 3,
  "controlLine": "visible",
  "testLine": "strong",
  "testDate": "2024-01-15T08:00:00Z",
  "brandName": "Clearblue Digital",
  "lotNumber": "LOT123",
  "expirationDate": "2025-01-15",
  "testTiming": "3",
  "testValidity": "valid",
  "sensitivityLevel": "25mIU/mL",
  "sampleType": "urine"
}
5-Parameter Monitor
{
  "heartRate": 78,
  "systolic": 125,
  "diastolic": 82,
  "oxygenSaturation": 97,
  "respiratoryRate": 16,
  "temperature": 37.1,
  "meanArterialPressure": 96,
  "pulsePressure": 43,
  "alarmIndicators": "none",
  "leadConfiguration": "3-lead",
  "waveformQuality": "good",
  "nibpCycleTime": "auto",
  "spo2SensorStatus": "connected",
  "temperatureProbe": "core",
  "patientInfo": "Bed 12A",
  "timestamp": "2024-01-15T10:15:00Z",
  "deviceStatus": "monitoring"
}
COVID Test Strip
{
  "testResult": "negative",
  "testType": "rapid antigen",
  "manufacturer": "Abbott BinaxNOW",
  "controlLine": "visible",
  "testLine": "not visible",
  "testDate": "2024-01-15T08:30:00Z",
  "lotNumber": "ABC123",
  "expirationDate": "2024-12-31",
  "testTiming": "15",
  "sampleType": "nasal swab",
  "sensitivity": "84.6%",
  "specificity": "98.5%",
  "serialNumber": "BNX789",
  "storageTemp": "2-30°C",
  "qrCode": "detected"
}
Prescription Document
{
  "patientName": "Jane Smith",
  "patientDOB": "1980-05-20",
  "patientAddress": "123 Main St",
  "prescriber": "Dr. Johnson",
  "prescriberNPI": "1234567890",
  "prescriberDEA": "BJ1234567",
  "pharmacy": "CVS Pharmacy",
  "datePrescribed": "2024-01-15",
  "medication": "Lisinopril",
  "genericName": "Lisinopril",
  "brandName": "Prinivil",
  "strength": "10mg",
  "quantity": 30,
  "directions": "Take 1 tablet daily by mouth",
  "refills": 5,
  "daysSupply": 30,
  "ndcNumber": "12345-678-90",
  "diagnosis": "Hypertension",
  "genericSubstitution": "allowed"
}
Discharge Summary
{
  "patientName": "Robert Brown",
  "patientDOB": "1965-08-12",
  "medicalRecordNumber": "MRN123456",
  "admissionDate": "2024-01-10",
  "dischargeDate": "2024-01-15",
  "primaryDiagnosis": "Acute Myocardial Infarction",
  "secondaryDiagnoses": ["Diabetes Type 2", "Hypertension"],
  "procedures": ["Cardiac catheterization", "Stent placement"],
  "attendingPhysician": "Dr. Williams",
  "dischargeMedications": "Aspirin 81mg daily, Metoprolol 50mg BID",
  "followUp": "Cardiology clinic in 1 week",
  "activityRestrictions": "No lifting >10lbs",
  "dietInstructions": "Low sodium, cardiac diet",
  "disposition": "Home with family",
  "vitalSignsAtDischarge": "BP: 128/78, HR: 68",
  "condition": "Stable"
}
Clinical Notes
{
  "patientName": "Mary Johnson",
  "patientDOB": "1975-11-03",
  "medicalRecordNumber": "MRN789012",
  "visitDate": "2024-01-15",
  "visitTime": "14:30",
  "provider": "Dr. Davis",
  "visitType": "office visit",
  "chiefComplaint": "Chest pain",
  "historyOfPresentIllness": "3-day history of chest discomfort",
  "reviewOfSystems": "Positive for chest pain, negative for SOB",
  "physicalExam": "Heart regular rate and rhythm",
  "vitalSigns": "BP: 130/85, HR: 72, Temp: 36.8°C, RR: 16, O2: 98%",
  "assessment": "Stable angina",
  "plan": "Continue current medications, stress test in 2 weeks",
  "medications": "Atorvastatin 40mg daily, Metoprolol 25mg BID",
  "allergies": "NKDA",
  "followUp": "Return in 2 weeks"
}

Error Handling

Error Response Format

{
  "success": false,
  "error": "Error description",
  "error_code": "ERROR_CODE",
  "details": {
    "field": "Additional error information"
  }
}

HTTP Status Codes

Status Code Description
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Rate limit exceeded
413Payload Too Large - Image exceeds size limit
415Unsupported Media Type - Invalid image format
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Common Error Codes

Authentication Errors
  • INVALID_API_KEY: API key is invalid or expired
  • MISSING_API_KEY: No API key provided
  • RATE_LIMIT_EXCEEDED: Too many requests
Image Processing Errors
  • INVALID_IMAGE_FORMAT: Unsupported image format
  • IMAGE_TOO_LARGE: Image exceeds size limit
  • IMAGE_PROCESSING_FAILED: Failed to process image
Data Extraction Errors
  • LOW_CONFIDENCE: Extraction confidence below threshold
  • UNREADABLE_DISPLAY: Cannot read device display
  • NO_DEVICE_DETECTED: No medical device found
Always check the success field before processing response data.

Rate Limits

Default Limits

Plan Requests/Hour Requests/Day Requests/Month
Free 100 1,000 10,000
Basic 1,000 10,000 100,000
Pro 5,000 50,000 500,000
Enterprise Custom Custom Custom

Rate Limit Headers

All responses include rate limit information:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1642248000
X-RateLimit-Window: 3600

Rate Limit Exceeded Response

{
  "success": false,
  "error": "Rate limit exceeded",
  "error_code": "RATE_LIMIT_EXCEEDED",
  "details": {
    "limit": 1000,
    "window_seconds": 3600,
    "reset_time": "2024-01-15T11:00:00Z"
  }
}

Best Practices

  • Monitor Headers: Check rate limit headers in responses
  • Implement Backoff: Use exponential backoff for retries
  • Cache Results: Cache successful extractions when possible
  • Batch Processing: Process multiple images efficiently
  • Upgrade Plan: Consider upgrading for higher limits

Code Examples

JavaScript/Node.js
const fs = require('fs');
const FormData = require('form-data');

async function extractMedicalData(imagePath, deviceType = null) {
  const form = new FormData();
  form.append('image', fs.createReadStream(imagePath));
  
  if (deviceType) {
    form.append('device_type', deviceType);
  }
  
  try {
    const response = await fetch('https://api.smartscanpro.ai/v1/extract-medical-data', {
      method: 'POST',
      headers: {
                            'X-API-Key': process.env.SMARTSCANPRO_API_KEY,
        ...form.getHeaders()
      },
      body: form
    });
    
    const result = await response.json();
    
    if (result.success) {
      console.log('Extracted data:', result.data.extracted_data);
      return result.data;
    } else {
      console.error('Extraction failed:', result.error);
      return null;
    }
  } catch (error) {
    console.error('Request failed:', error);
    return null;
  }
}

// Usage
extractMedicalData('./blood_pressure_reading.jpg', 'blood-pressure')
  .then(data => {
    if (data) {
      const extracted = data.extracted_data;
      console.log(`Blood Pressure: ${extracted.systolic}/${extracted.diastolic} mmHg`);
      console.log(`Pulse: ${extracted.pulse} BPM`);
    }
  });
Python
import requests
import os

class SmartScanProClient:
    def __init__(self, api_key, base_url="https://api.smartscanpro.ai"):
        self.api_key = api_key
        self.base_url = base_url
        
    def extract_medical_data(self, image_path, device_type=None, confidence_threshold=None):
        """Extract medical data from device image."""
        
        url = f"{self.base_url}/v1/extract-medical-data"
        headers = {"X-API-Key": self.api_key}
        
        files = {"image": open(image_path, "rb")}
        data = {}
        
        if device_type:
            data["device_type"] = device_type
        if confidence_threshold:
            data["confidence_threshold"] = confidence_threshold
            
        try:
            response = requests.post(url, headers=headers, files=files, data=data)
            result = response.json()
            
            if result.get("success"):
                return result["data"]
            else:
                raise Exception(f"API Error: {result.get('error', 'Unknown error')}")
                
        except requests.exceptions.RequestException as e:
            raise Exception(f"Request failed: {str(e)}")
        finally:
            files["image"].close()

# Usage
client = SmartScanProClient(os.getenv("SMARTSCANPRO_API_KEY"))

try:
    data = client.extract_medical_data(
        "blood_pressure_reading.jpg",
        device_type="blood-pressure"
    )
    
    extracted = data["extracted_data"]
    print(f"Blood Pressure: {extracted['systolic']}/{extracted['diastolic']} {extracted['unit']}")
    print(f"Pulse: {extracted['pulse']} BPM")
    print(f"Confidence: {data['confidence']:.2%}")
    
except Exception as e:
    print(f"Error: {e}")
cURL
# Basic request
curl -X POST \
  https://api.smartscanpro.ai/v1/extract-medical-data \
  -H "X-API-Key: dk_your_api_key_here" \
  -F "image=@blood_pressure_reading.jpg" \
  -F "device_type=blood-pressure"

# With confidence threshold
curl -X POST \
  https://api.smartscanpro.ai/v1/extract-medical-data \
  -H "X-API-Key: dk_your_api_key_here" \
  -F "image=@glucose_reading.jpg" \
  -F "device_type=glucose-meter" \
  -F "confidence_threshold=0.8"
React Hook
import { useState, useCallback } from 'react';

export const useSmartScanProAPI = (apiKey) => {
  const [loading, setLoading] = useState(false);
  const [error, setError] = useState(null);
  
  const extractData = useCallback(async (imageFile, options = {}) => {
    setLoading(true);
    setError(null);
    
    try {
      const formData = new FormData();
      formData.append('image', imageFile);
      
      if (options.deviceType) {
        formData.append('device_type', options.deviceType);
      }
      
      const response = await fetch('/api/v1/extract-medical-data', {
        method: 'POST',
        headers: {
          'X-API-Key': apiKey
        },
        body: formData
      });
      
      const result = await response.json();
      
      if (!result.success) {
        throw new Error(result.error);
      }
      
      return result.data;
      
    } catch (err) {
      setError(err.message);
      throw err;
    } finally {
      setLoading(false);
    }
  }, [apiKey]);
  
  return { extractData, loading, error };
};

// Component usage
export const MedicalDeviceUploader = () => {
  const { extractData, loading, error } = useSmartScanProAPI(process.env.REACT_APP_API_KEY);
  const [result, setResult] = useState(null);
  
  const handleFileUpload = async (event) => {
    const file = event.target.files[0];
    if (!file) return;
    
    try {
      const data = await extractData(file, {
        deviceType: 'blood-pressure'
      });
      setResult(data);
    } catch (err) {
      console.error('Upload failed:', err);
    }
  };
  
  return (
    
{loading &&

Processing image...

} {error &&

Error: {error}

} {result && (

Extracted Data:

{JSON.stringify(result.extracted_data, null, 2)}
)}
); };
Ready to get started? Create your account and start extracting medical device data in minutes!