API docs
Everything the website does, your bot can do too. All responses are JSON. Base URL: https://msac.fyi
This service checks every server once per minute, so there's nothing new to get by asking faster. Please only ask once or twice a minute.
This is part of our Terms of Service. If a key asks more than 30 times in a minute (or 300 times in an hour), it trips our safety system and the key is marked Invalid. It then stops working until you log in and press Reset key on the API key page.
Authentication
Log in (or sign up), click API key in the top corner and make a key. Then send it with every request:
Authorization: Bearer mcm_your_key_here
(X-API-Key: mcm_… works too.) Keep it secret, like a bot token. If it leaks, make a new one on the API key page.
Limits in short
- At most 30 requests a minute or 300 an hour per key. Going over marks your key as invalid (every request then gets
403) until you make a new key on the API key page. - Servers are checked every 60 seconds, so polling faster than that gets you nothing new.
- Each key can track a limited number of servers.
GET /api/v1/meshows yours.
Endpoints
GET/api/v1/servers
All your servers with live status and stats. This is usually the only call a bot needs.
{
"servers": [{
"id": 12,
"label": "Survival",
"address": "play.example.net",
"edition": "java",
"status": {
"online": true,
"for_seconds": 5400, // how long it's been online (or offline)
"since": 1764780000, // unix time that streak started
"ping_ms": 42.1,
"players_online": 7,
"players_max": 50,
"version": "Paper 1.21.4",
"motd": "Welcome!",
"error": null, // why it's offline, e.g. "Timed out"
"checked_at": 1764785400
},
"stats": {
"hour": { "uptime_percent": 100.0, "avg_ping_ms": 41.8, "min_ping_ms": 38, "max_ping_ms": 51, "peak_players": 8, "checks": 60 },
"day": { ... }, "week": { ... }, "month": { ... }, "year": { ... }
}
}]
}
New servers are checked as soon as they're added, so status is filled in straight away.
GET/api/v1/servers/{id}
One server, same shape as above.
GET/api/v1/servers/{id}/history?range=day
Points for drawing a graph. range is hour, day, week, month or year. Each point is an average over bucket_seconds.
{ "id": 12, "range": "day", "bucket_seconds": 360, "since": 1764699000,
"points": [ { "t": 1764699120, "ping_ms": 43.2, "uptime_percent": 100.0, "players": 6 }, ... ] }
POST/api/v1/servers
{ "address": "play.example.net:25565", "label": "Survival", "edition": "java" }
edition is java (default) or bedrock. Checks the server first (up to a few seconds), then returns 201 with the new server and its live status. Fails with 403 when you're out of slots.
PATCH/api/v1/servers/{id}
{ "label": "New name" }
DELETE/api/v1/servers/{id}
Stops tracking it and deletes your history for it.
GET/api/v1/me
{ "account": 12, "key_prefix": "mcm_AbC12", "servers_used": 1, "server_limit": 2, "unlimited": false,
"api_suspended": false, "suspend_after": { "per_minute": 30, "per_hour": 300 },
"check_interval_seconds": 60 }
server_limit is null and unlimited is true when there's no limit.
POST/api/v1/key/rotate
Makes a new key and turns off the old one straight away. The new key is in api_key.
Errors
Errors look like {"error": "message"} with a matching status code:
| Code | Meaning |
|---|---|
| 400 | Bad input (e.g. invalid address) |
| 401 | Missing or wrong key |
| 403 | Key invalid (too many requests), account disabled, or out of server slots |
| 404 | That server id isn't one of yours |
| 409 | You already track that address |
Examples
curl
curl -H "Authorization: Bearer $MCM_KEY" https://msac.fyi/api/v1/servers
Discord bot (discord.js)
// /status command: replies with every server's state
const res = await fetch("https://msac.fyi/api/v1/servers", {
headers: { Authorization: `Bearer ${process.env.MCM_KEY}` },
});
const { servers } = await res.json();
const lines = servers.map(s => {
const st = s.status;
if (!st) return `⏳ **${s.label || s.address}**: checking…`;
return st.online
? `🟢 **${s.label || s.address}**: ${st.players_online}/${st.players_max} players, ${Math.round(st.ping_ms)} ms, ${s.stats.day.uptime_percent}% up today`
: `🔴 **${s.label || s.address}**: offline (${st.error})`;
});
await interaction.reply(lines.join("\n"));
Discord bot (discord.py)
import os, aiohttp
async def get_servers():
headers = {"Authorization": f"Bearer {os.environ['MCM_KEY']}"}
async with aiohttp.ClientSession(headers=headers) as s:
async with s.get("https://msac.fyi/api/v1/servers") as r:
r.raise_for_status()
return (await r.json())["servers"]