API Documentation
Integrate MC Server List data into your applications, bots, or websites using our REST API.
Base URL
https://msl.appahouse.com/apiAll API endpoints are relative to this base URL. Responses are in JSON format.
Authentication
Most read endpoints are public and don't require authentication. Write operations require authentication via session cookies or API keys.
Rate Limiting
API requests are rate limited to prevent abuse:
- • Anonymous: 20 requests per minute
- • Authenticated: 100 requests per minute
Endpoints
Servers
/serversList all approved servers with optional filtering and pagination.
Query Parameters
limit - Number of results (default: 20, max: 100)offset - Pagination offsetsort - Sort by: votes, players, newest, uptimetype - Server type filtergameMode - Game mode filterExample Request
curl "https://msl.appahouse.com/api/servers?limit=10&sort=votes"Example Response
{
"servers": [
{
"id": "uuid-here",
"name": "Example Server",
"ipAddress": "play.example.com",
"port": 25565,
"isOnline": true,
"currentPlayers": 42,
"maxPlayers": 100,
"voteCount": 1234,
"serverType": "paper",
"gameModes": ["survival", "skyblock"],
...
}
],
"total": 150,
"hasMore": true
}/servers/:serverIdGet detailed information about a specific server.
Example Request
curl "https://msl.appahouse.com/api/servers/abc-123-uuid"/servers/:serverId/statsGet historical statistics for a server (player counts, uptime, etc.).
Query Parameters
days - Number of days of history (default: 7, max: 30)Voting
/servers/:serverId/voteSubmit a vote for a server. Rate limited to one vote per IP per server per day.
Example Request
curl -X POST "https://msl.appahouse.com/api/servers/abc-123/vote"Response
{
"success": true,
"newVoteCount": 1235,
"nextVoteAt": "2024-01-16T00:00:00Z"
}Real-time Updates
/servers/status-streamServer-Sent Events (SSE) endpoint for real-time server status updates.
Query Parameters
serverIds - Comma-separated server IDs to subscribe to (optional, defaults to all)JavaScript Example
const eventSource = new EventSource('/api/servers/status-stream');
eventSource.onmessage = (event) => {
const update = JSON.parse(event.data);
console.log('Server status update:', update);
// { type: 'status_update', serverId: '...', currentStatus: true, ... }
};
eventSource.onerror = (error) => {
console.error('SSE error:', error);
};Webhooks
Set up webhooks to receive real-time notifications when events happen on your server.
/servers/:serverId/webhooksList all webhooks configured for a server. Requires authentication.
/servers/:serverId/webhooksCreate a new webhook. Supports Discord, Slack, and generic HTTP endpoints.
Request Body
{
"name": "Discord Alerts",
"url": "https://discord.com/api/webhooks/...",
"webhookType": "discord",
"events": ["server.vote", "server.offline", "server.milestone"]
}Supported Events
server.vote - New vote receivedserver.review - New review postedserver.online - Server came onlineserver.offline - Server went offlineserver.milestone - Vote milestone reached/servers/:serverId/webhooks/:webhookId/testSend a test payload to verify your webhook is working correctly.
Error Handling
The API uses standard HTTP status codes and returns error details in JSON format.
Error Response Format
{
"error": "Server not found",
"code": "NOT_FOUND",
"details": {}
}