Skip to main content

ECG Basic API

The Basic tier provides core ECG signal analysis capabilities, supporting both single-lead and 12-lead ECG analysis.

Use cases
  • Wearable device ECG monitoring
  • Health management apps
  • Preliminary ECG screening
  • Development & test validation
Signal quality guidance

All analysis endpoints return a sqGrade field to indicate signal quality. It is recommended to use results when sqGrade >= 0.7. View detailed signal quality guidance →


Single-lead ECG analysis

POST /api/v1/basic/ecg/1-lead/analyze

Analyze a single-lead ECG signal and return diagnosis conclusions and ECG parameters.

Request parameters

ParameterTypeRequiredDescription
ecgDataarrayECG signal data array (ADC values)
ecgSampleRatenumberSampling rate (Hz, recommended 250–500)
adcGainnumberGain coefficient (default: 1.0)
adcZeronumberZero/baseline voltage (default: 0.0)

Request example

curl -X POST "https://api.heartvoice.com.cn/api/v1/basic/ecg/1-lead/analyze" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ecgData": [512, 515, 520, 518, 525, ...],
"ecgSampleRate": 500,
"adcGain": 1.0,
"adcZero": 0.0
}'

Response example

{
"errorCode": "0",
"msg": "success",
"data": {
"isAbnormal": false,
"isReverse": false,
"sqGrade": "0.95",
"diagnosis": [
"SN"
],
"possibleDiags": [],
"pacCount": 0,
"pvcCount": 0,
"avgHr": 73,
"avgQrs": 94,
"prInterval": 152,
"avgQt": 348,
"avgP": 104,
"avgQtc": 384
}
}

12-lead ECG analysis

POST /api/v1/basic/ecg/12-lead/analyze

Analyze a standard 12-lead ECG signal to provide more comprehensive ECG diagnosis.

Request parameters

ParameterTypeRequiredDescription
dataIarrayLead I data
dataIIarrayLead II data
dataIIIarrayLead III data
dataAVRarrayLead aVR data
dataAVLarrayLead aVL data
dataAVFarrayLead aVF data
dataV1arrayLead V1 data
dataV2arrayLead V2 data
dataV3arrayLead V3 data
dataV4arrayLead V4 data
dataV5arrayLead V5 data
dataV6arrayLead V6 data
ecgSampleRatenumberSampling rate (Hz)
adcGainnumberGain coefficient
adcZeronumberZero/baseline voltage (default: 0.0)

Request example format

{
"dataI": [512, 515, 520, ...],
"dataII": [510, 518, 522, ...],
"dataIII": [508, 512, 515, ...],
"dataAVR": [520, 518, 515, ...],
"dataAVL": [515, 520, 518, ...],
"dataAVF": [510, 515, 520, ...],
"dataV1": [512, 518, 525, ...],
"dataV2": [515, 520, 528, ...],
"dataV3": [518, 525, 530, ...],
"dataV4": [520, 528, 535, ...],
"dataV5": [522, 530, 538, ...],
"dataV6": [525, 532, 540, ...],
"ecgSampleRate": 500,
"adcGain": 1000.0,
"adcZero": 0.0
}

Request example

curl -X POST "https://api.heartvoice.com.cn/api/v1/basic/ecg/12-lead/analyze" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d @ecg_12lead_data.json

Response example

{
"errorCode": "0",
"msg": "success",
"data": {
"id": "2008115544300990464",
"analysisState": true,
"diagnoses": [
{
"label": "SN",
"result": "Sinus rhythm",
"description": "P wave: I & II upright, aVR inverted, V5 & V6 upright"
}
],
"riskLevel": 0,
"HR": 73,
"QRSaxis": 240,
"P": 90,
"PR": 125,
"QRS": 126,
"QT": 377,
"QTc": 416,
"T": 163,
"SV1": -0.86,
"SV2": -0.86,
"SV5": -0.86,
"RV1": 0.59,
"RV2": 0.59,
"RV5": 0.59,
"RV6": 0.59,
"Paxis": 60,
"Taxis": 60,
"AtrialRate": 74,
"VentricularRate": 72
}
}
12-lead diagnosis label guidance
  • The label field is the diagnosis label code. Convert it using the Diagnosis label reference table.
  • The result field is the diagnosis result label (NORMAL/ABNORMAL/BORDERLINE).
  • The description field is a detailed description text.

Response field descriptions

Single-lead response fields

FieldTypeDescription
isAbnormalbooleanWhether it is abnormal
isReversebooleanWhether the lead is reversed/miswired
sqGradestringSignal quality grade (numeric string) View detailed guidance
diagnosisarrayList of diagnosis result label codes (codes need mapping)
possibleDiagsarrayList of possible diagnosis label codes (candidate codes)
pacCountnumberPAC count (premature atrial contractions)
pvcCountnumberPVC count (premature ventricular contractions)
avgHrnumberAverage heart rate (bpm)
avgQrsnumberAverage QRS width (ms)
prIntervalnumberPR interval (ms)
avgQtnumberAverage QT interval (ms)
avgPnumberAverage P-wave width (ms)
avgQtcnumberAverage QTc interval (ms)
Diagnosis label guidance

The diagnosis and possibleDiags fields return diagnosis label codes. Convert them using the mapping table below (Diagnosis label reference table).

12-lead response fields

FieldTypeDescription
idstringData ID
analysisStatebooleanAnalysis status
diagnosesarrayArray of diagnosis result objects
HRnumberHeart rate (bpm)
QRSaxisnumberQRS electrical axis (degrees)
PnumberP-wave width (ms)
PRnumberPR interval (ms)
QRSnumberQRS width (ms)
QTnumberQT interval (ms)
QTcnumberQTc interval (ms)
TnumberT-wave width (ms)
SV1/SV2/SV5numberS-wave voltage
RV1/RV2/RV5/RV6numberR-wave voltage
PaxisnumberP-wave electrical axis (degrees)
TaxisnumberT-wave electrical axis (degrees)
AtrialRatenumberAtrial rate (bpm)
VentricularRatenumberVentricular rate (bpm)
riskLevelnumberRisk level: 0 none, 1 low, 2 medium, 3 high

diagnoses object structure (12-lead)

FieldTypeDescription
labelstringDiagnosis label code (see Diagnosis label reference table)
resultstringDiagnosis result label (corresponding Chinese label in the original doc)
descriptionstringDetailed description text

Reference ranges for ECG parameters

ParameterNormal rangeDescription
HR (heart rate)60–100 bpmHeart rate
QRS width80–120 msQRS width
QTc interval350–440 msCorrected QT interval
PR interval120–200 msPR interval
QRS electrical axis-30°–90°Electrical axis

Diagnosis label reference table

Single-lead diagnosis labels

The labels returned by the diagnosis and possibleDiags fields correspond to the following descriptions:

Label codeEnglish descriptionNotes
SNSinus rhythmNormal rhythm originating from the sinoatrial node
NNormal ECGECG without obvious abnormality
SNAIrregular sinus rhythmSinus rhythm with irregular rhythm, often related to respiration
SNTSinus tachycardiaSinus rhythm with heart rate above the normal range
SNBSinus bradycardiaSinus rhythm with heart rate below the normal range
AFAtrial fibrillationDisordered rapid atrial activation with an absolutely irregular rhythm
AFLAtrial flutterRegular rapid re-entrant atrial activation
VTVentricular tachycardiaFast rhythm originating from the ventricles; potentially dangerous
SVTSupraventricular tachycardiaFast rhythm originating above the ventricles
PVCPremature ventricular contractionPremature beats originating in the ventricles
PJCJunctional premature beatPremature beat from the AV junction region
PACPremature atrial contractionPremature beat originating in the atrium
AVBIFirst-degree atrioventricular blockAV conduction delay, but every impulse is conducted
AVBIISecond-degree atrioventricular blockNot all atrial impulses are conducted to the ventricles
AVBIIIThird-degree atrioventricular blockComplete AV block; atrial and ventricular activity are independent
AEAtrial escape beatProtective escape beat appearing with delayed atrial pacing site
IVBIntraventricular conduction blockDelayed or blocked intraventricular conduction
LBBBLeft bundle branch blockLeft bundle branch conduction block causing abnormal ventricular activation
RBBBRight bundle branch blockRight bundle branch conduction block causing abnormal ventricular activation
LAFBLeft anterior fascicular blockConduction block in the left anterior fascicle
JEJunctional escape beatEscape rhythm originating from the AV junction area
VEVentricular escape beatEscape rhythm originating from the ventricles
LVHLeft ventricular hypertrophyECG pattern suggestive of left ventricular hypertrophy
PACEDPaced rhythmRhythm generated by an artificial pacemaker
WPWWPWPre-excitation syndrome with an accessory pathway
SINGLE_PACSingle PACIsolated premature atrial contraction
PAIRED_PACPaired PACTwo consecutive premature atrial contractions
BIGEMINY_PACBigeminy PACPremature atrial contractions alternate with normal beats
TRIAD_PACTrigeminy PACOne premature atrial contraction appears in every three beats
SINGLE_PVCSingle PVCIsolated premature ventricular contraction
PAIRED_PVCPaired PVCTwo consecutive premature ventricular contractions
BIGEMINY_PVCBigeminy PVCPremature ventricular contractions alternate with normal beats
TRIAD_PVCTrigeminy PVCOne premature ventricular contraction appears in every three beats

12-lead diagnosis labels

Label codeEnglish descriptionNotes
SNSinus rhythmNormal rhythm originating from the sinoatrial node
NSinus rhythm (normal ECG)Overall ECG presentation is normal
SNAIrregular sinus rhythmSinus rhythm with irregularity, often associated with respiration
SNTSinus tachycardiaSinus rhythm with heart rate above normal range
SNBSinus bradycardiaSinus rhythm with heart rate below normal range
AFAtrial fibrillationDisordered rapid atrial activation with absolutely irregular rhythm
PVCPremature ventricular contractionPremature beats from the ventricles
PACPremature atrial contractionPremature beats from the atria
AFLAtrial flutterRegular rapid re-entrant atrial activation
LVHLeft ventricular high voltageECG suggests possible left ventricular hypertrophy
LBBBLeft bundle branch blockLeft bundle conduction block causing abnormal ventricular activation
RBBBRight bundle branch blockRight bundle conduction block causing abnormal ventricular activation
IVBIntraventricular conduction blockDelayed or blocked conduction inside the ventricles
RBBB_CComplete right bundle branch blockComplete conduction block
RBBB_IIncomplete right bundle branch blockPartial conduction block
LAFBLeft anterior fascicular blockConduction block in the left anterior fascicle
WPWWPWPre-excitation due to an accessory pathway causing early ventricular activation
LGLLGL syndromePre-excitation syndrome with short PR interval and no delta wave
AVBIFirst-degree AV blockAV conduction delay but every impulse is conducted
AVBIISecond-degree AV blockSome atrial impulses cannot conduct to ventricles
AVBIIIThird-degree AV blockComplete AV block; atrial and ventricular activity independent
STST-segment abnormalityAbnormal ST elevation or depression
TT-wave abnormalityAbnormal T-wave morphology or direction
STTST-T abnormalityAbnormalities in both ST segment and T wave
PACEDPaced rhythmRhythm generated by an artificial pacemaker
CWClockwise rotationCardiac electrical axis or waveform rotates clockwise
CCWCounter-clockwise rotationCardiac electrical axis or waveform rotates counter-clockwise
LADLeft axis deviationElectrical axis shifts to the left
RADRight axis deviationElectrical axis shifts to the right
ERADMarked right axis deviationProminent rightward electrical axis shift
BLVLow limb-lead voltageReduced QRS amplitude in limb leads
CLVLow chest-lead voltageReduced QRS amplitude in precordial leads
VTVentricular tachycardiaFast rhythm originating from the ventricles; dangerous
SVTSupraventricular tachycardiaFast rhythm originating above the ventricles
QAbnormal Q wavesAbnormal Q waves, possibly indicating myocardial necrosis
QT_LProlonged Q-Tc intervalCorrected QT prolongation with arrhythmia risk
QRS_LQRS wideningProlonged ventricular depolarization time
JEJunctional escape beatEscape rhythm from the AV junction
VEVentricular escape beatEscape rhythm from the ventricles
AEAtrial escape beatEscape rhythm from the atria
PJCJunctional premature beatEarly beats from the AV junction region
PAUSEAsystoleTemporarily interrupted cardiac beats
ALLFALLLead lossMultiple leads are missing or abnormal
LIMBFALLLimb lead lossLimb lead signal is missing
CHESTFALLChest lead lossPrecordial lead signal is missing
Label guidance
  • The label lists above will be continuously updated based on the actual model capability.
  • A single analysis may return multiple labels.
  • possibleDiags includes possible diagnoses with lower confidence.
  • The actual label content is subject to what the API returns.

12-lead


Next steps