Skip to main content

Status API 📊

The Status API provides real-time information about Scare Bot’s performance, uptime, and system metrics.

Endpoint

GET /api/status

Base URL

http://localhost:1337/api/status

Description

This endpoint returns comprehensive status information including:
  • Performance Metrics: Latency, uptime, and response times
  • Bot Statistics: Server count, user count, and command usage
  • System Health: Memory usage, CPU utilization, and error rates
  • Real-time Data: Live updates of bot performance

Response Format

Success Response

{
  "stats": {
    "timestamp": "2025-08-25T06:46:26.513816+00:00Z",
    "guilds": 1,
    "users": 41,
    "channels": 10,
    "shards": 1,
    "latency": 124,
    "uptime": "6m 1s",
    "commands_used": 486,
    "shard_stats": {
      "0": {
        "id": 0,
        "guilds": 1,
        "users": 41,
        "latency": 124,
        "status": "online"
      }
    }
  }
}

Error Response

{
  "error": "Failed to fetch status",
  "status": "error"
}

Response Fields

FieldTypeDescriptionExample
stats.timestampstringISO 8601 timestamp of the request"2025-08-25T06:46:26.513816+00:00Z"
stats.guildsintegerNumber of Discord servers the bot is in1
stats.usersintegerTotal number of users across all servers41
stats.channelsintegerTotal number of channels across all servers10
stats.shardsintegerNumber of Discord shards1
stats.latencyintegerBot’s latency to Discord API in milliseconds124
stats.uptimestringHow long the bot has been running"6m 1s"
stats.commands_usedintegerTotal number of commands used486
stats.shard_statsobjectDetailed information for each shardSee below

Shard Statistics

{
  "0": {
    "id": 0,
    "guilds": 1,
    "users": 41,
    "latency": 124,
    "status": "online"
  }
}
FieldTypeDescriptionExample
idintegerShard ID0
guildsintegerNumber of guilds on this shard1
usersintegerNumber of users on this shard41
latencyintegerShard latency in milliseconds124
statusstringShard connection status"online"

Status Codes

CodeDescription
200Success - Status data returned
500Internal Server Error
503Service Unavailable

Headers

Request Headers

Accept: application/json
User-Agent: Scare-Bot-API/1.0

Response Headers

Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET

Examples

cURL Request

curl -X GET "http://localhost:1337/api/status" \
  -H "Accept: application/json"

JavaScript (Fetch)

const response = await fetch('http://localhost:1337/api/status');
const data = await response.json();

console.log(`Bot is serving ${data.stats.guilds} servers`);
console.log(`Latency: ${data.stats.latency}ms`);
console.log(`Uptime: ${data.stats.uptime}`);

Python (requests)

import requests

response = requests.get('http://localhost:1337/api/status')
data = response.json()

print(f"Bot is serving {data['stats']['guilds']} servers")
print(f"Latency: {data['stats']['latency']}ms")
print(f"Uptime: {data['stats']['uptime']}")

Node.js (axios)

const axios = require('axios');

const response = await axios.get('http://localhost:1337/api/status');
const data = response.data;

console.log(`Bot is serving ${data.stats.guilds} servers`);
console.log(`Latency: ${data.stats.latency}ms`);
console.log(`Uptime: ${data.stats.uptime}`);

Rate Limiting

  • Requests per minute: 60
  • Requests per hour: 1000
  • Rate limit headers: Included in response

Caching

  • Cache-Control: no-cache
  • Data freshness: Real-time (no caching)
  • Update frequency: Every request

Use Cases

Monitoring Dashboards

  • Real-time bot performance monitoring
  • Uptime tracking and alerting
  • Performance metrics visualization

Health Checks

  • Automated health monitoring
  • Service availability checks
  • Performance benchmarking

Analytics

  • Bot usage statistics
  • Server growth tracking
  • Performance trend analysis

Bot Info API

Get detailed bot information and statistics

Commands API

Get list of all available commands

Guilds API

Get information about bot’s guilds

Error Handling

Common Errors

ErrorDescriptionSolution
ECONNREFUSEDBot server is not runningStart the bot server
ETIMEDOUTRequest timed outCheck network connection
500Internal server errorCheck bot logs

Error Response Format

{
  "error": "Failed to fetch status",
  "message": "Bot server is not responding",
  "status": "error",
  "timestamp": "2025-08-25T06:46:26.513816+00:00Z"
}

Need help? Join our Support Server for API assistance!