REST API ยท Data Intelligence Platform
Programmatically access TMI Core metrics, history, and system data
GET /api.php?action=current
GET /api.php?action=history
GET /api.php?action=stats
GET /api.php?action=events
POST /ingest.php
Headers: X-API-Key: your_api_key
Body: {
"ingest_rate": 4.21,
"active_streams": 1500,
"latency_ms": 42,
"trust_index": 99.98
}
curl "https://tmi.kanti.pro/api.php?action=current"
import requests
# Get current metrics
response = requests.get('https://tmi.kanti.pro/api.php?action=stats')
data = response.json()
print(f"Total Records: {data['total_records']}")
print(f"Avg Ingest Rate: {data['avg_ingest_rate']}M/s")
// Get current metrics
fetch('https://tmi.kanti.pro/api.php?action=stats')
.then(res => res.json())
.then(data => {
console.log(`Total Records: ${data.total_records}`);
console.log(`Avg Ingest Rate: ${data.avg_ingest_rate}M/s`);
});
{
"status": "success",
"total_records": 505,
"avg_ingest_rate": 12.80,
"peak_ingest_rate": 46.82,
"avg_latency_ms": 163,
"avg_trust_index": 16.79,
"today_records": 505
}
| Code | Meaning | Solution |
|---|---|---|
| 200 | Success | - |
| 400 | Bad Request | Invalid action parameter |
| 401 | Unauthorized | Invalid or missing API key (for POST) |
| 404 | Not Found | Endpoint doesn't exist |
| 500 | Server Error | Database connection issue |