๐Ÿš€ REST API Endpoint

Programmatically access TMI Core metrics, history, and system data

๐ŸŸข https://tmi.kanti.pro/api.php
...
Total Records
...
Avg Ingest Rate
...
Peak Rate
...
Avg Latency
...
Data Quality
...
Today's Activity

๐Ÿ“– API Documentation

๐Ÿ“Š Get Current Metrics

GET /api.php?action=current

๐Ÿ“œ Get History

GET /api.php?action=history

๐Ÿ“ˆ Get Stats Summary

GET /api.php?action=stats

๐Ÿ”„ Get Events Feed

GET /api.php?action=events

๐Ÿ“ฅ Send Data (Ingestion)

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
}

๐Ÿงช Live API Test

Click "Send Request" to test the API...

๐Ÿ“‹ cURL Examples

curl "https://tmi.kanti.pro/api.php?action=current"

๐Ÿ Python Example

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")

๐Ÿ“˜ JavaScript/Node.js Example

// 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`);
  });

๐Ÿ“‹ Response Examples

{
  "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
}

โš ๏ธ Error Codes

CodeMeaningSolution
200Success-
400Bad RequestInvalid action parameter
401UnauthorizedInvalid or missing API key (for POST)
404Not FoundEndpoint doesn't exist
500Server ErrorDatabase connection issue

๐Ÿ”„ Recent Data Points

Loading recent metrics...