Quick Start
Welcome to AIECG’s ECG signal analysis cloud service! This guide helps you complete API integration in 3 minutes.
🎯 What is AIECG?
AIECG provides professional ECG (ECG) signal analysis API services, enabling your wearable devices and health applications with medical-grade ECG diagnostic capabilities.
Core capabilities:
- ✅ 98.6% diagnostic accuracy
- ✅ 3s average response time
- ✅ Single-lead supports recognition of 20+ arrhythmia types, and 12-lead supports 43+ ECG conditions
- ✅ Supports both single-lead and 12-lead analysis
- ✅ Easy to integrate: 5 lines of code
📦 Step 1: Get an API Key
- Visit the Developer Console
- Copy your key from the API Keys page
sk-aiecg-xxxxxxxxxxxxxxxxxxxxxxxx
New user benefits
Register to get 100 free API calls right away—enough for development and testing!
🚀 Step 2: Call the API
Single-lead ECG analysis
- cURL
- JavaScript
- Python
curl -X POST "https://api.heartvoice.com.cn/v1/basic/ecg/1-lead/analyze" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ecgData": [512, 515, 520, 518, 525, 530, 528, 522, 515, 508, ...],
"ecgSampleRate": 500,
"adcGain": 1000.0,
"adcZero": 0.0
}'
const response = await fetch('https://api.heartvoice.com.cn/v1/basic/ecg/1-lead/analyze', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
ecgData: ecgSignalData, // Your ECG signal array
ecgSampleRate: 500, // Sampling rate (Hz)
adcGain: 1000.0, // Gain factor
adcZero: 0.0 // Zero offset voltage
})
});
const result = await response.json();
console.log(result.data.diagnosis); // ["SINUS_RHYTHM", "NORMAL_ECG"]
console.log(result.data.avgHr); // 72
console.log(result.data.sqGrade); // "0.92"
import requests
response = requests.post(
'https://api.heartvoice.com.cn/v1/basic/ecg/1-lead/analyze',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'ecgData': ecg_signal_data, # Your ECG signal list
'ecgSampleRate': 500, # Sampling rate (Hz)
'adcGain': 1000.0, # Gain factor
'adcZero': 0.0 # Zero offset voltage
}
)
result = response.json()
print(f"Diagnosis: {', '.join(result['data']['diagnosis'])}") # SINUS_RHYTHM, NORMAL_ECG
print(f"Heart rate: {result['data']['avgHr']} BPM")
print(f"Signal quality: {result['data']['sqGrade']}")
📊 Response Example
{
"code": 200,
"message": "success",
"data": {
"isAbnormal": false,
"isReverse": false,
"sqGrade": "0.92",
"diagnosis": [
"SINUS_RHYTHM",
"NORMAL_ECG"
],
"possibleDiags": [],
"pacCount": 0,
"pvcCount": 1,
"avgHr": 72,
"avgQrs": 88,
"prInterval": 160,
"avgQt": 380,
"avgP": 100,
"avgQtc": 392
}
}
Key Fields
| Field | Description |
|---|---|
isAbnormal | Whether an abnormality is detected |
isReverse | Whether the lead is reversed/miswired |
sqGrade | Signal quality grade (numeric string, 0-1) |
diagnosis | Array of diagnosis label codes (returned tags) |
possibleDiags | Array of possible diagnosis labels |
avgHr | Average heart rate (bpm) |
avgQrs | Average QRS width (ms) |
prInterval | PR interval (ms) |
avgQt | Average QT interval (ms) |
avgQtc | Corrected QT interval (ms) |
pacCount | Count of PAC (premature atrial contractions) |
pvcCount | Count of PVC (premature ventricular contractions) |
Diagnosis label explanation
The diagnosis field returns diagnosis label codes (for example, SINUS_RHYTHM). Convert them to readable descriptions using the Diagnosis label reference table.
🎉 Completed!
Congratulations! You’ve successfully made your first call to the AIECG API.
Next Steps
📖 ECG Basic
Detailed docs for single-lead and 12-lead analysis
🔬 ECG Advanced
HRV, heart age, DeepLife, and more
🧪 Online Test
Use the Playground to test the API
📚 API Overview
ECG Signal Analysis
| Endpoint | Description | Plan |
|---|---|---|
POST /v1/basic/ecg/1-lead/analyze | Single-lead ECG analysis | Basic+ |
POST /v1/basic/ecg/12-lead/analyze | 12-lead ECG analysis | Basic+ |
POST /v1/advanced/ecg/analyze | Full ECG analysis (includes HRV, heart age, etc.) | Advanced+ |
POST /v1/advanced/ecg/heart-age | Heart age assessment | Advanced+ |
POST /v1/advanced/ecg/mental-state | Mental/emotional state assessment | Advanced+ |
POST /v1/advanced/ecg/micro-exam | DeepLife micro health check | Advanced+ |
POST /v1/advanced/ecg/holter/* | Long-term ECG analysis (asynchronous) | Advanced+ |
PPG Signal Analysis
| Endpoint | Description | Plan |
|---|---|---|
POST /v1/advanced/ppg/blood-pressure | Blood pressure estimation | Advanced+ |
POST /v1/advanced/ppg/vascular-health | Vascular health assessment | Advanced+ |