Skip to content

Fast and reliable Minecraft server status checker API for both Java and Bedrock editions. Get real-time information about any Minecraft server including player count, version, MOTD, and more.

License

Notifications You must be signed in to change notification settings

devRaikou/mc-server-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft Server Status API

Fast and reliable Minecraft server status checker API for both Java and Bedrock editions. Get real-time information about any Minecraft server including player count, version, MOTD, and more.

🌐 Live Demo

Visit https://api.raikou.me to try out the API.

✨ Features

  • Support for both Java and Bedrock edition servers
  • Real-time server status checking
  • Detailed server information (version, MOTD, players, etc.)
  • Fast response times
  • Clean and modern web interface
  • RESTful API endpoints
  • Rate limiting for API stability

🚀 API Usage

Java Edition

GET https://api.raikou.me/v1/status/java/{server-address}

Bedrock Edition

GET https://api.raikou.me/v1/status/bedrock/{server-address}

Example Response

{
  "online": true,
  "ip": "play.example.com",
  "port": 25565,
  "hostname": "play.example.com",
  "version": "1.20.1",
  "players": {
    "online": 100,
    "max": 1000
  },
  "motd": "Welcome to our server!",
  "latency": 42,
  "edition": "java"
}

🛠️ Self Hosting

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • nginx
  • pm2

Installation

  1. Clone the repository
git clone https://github.com/devRaikou/mc-server-api.git
cd mc-server-api
  1. Install dependencies
npm install
  1. Create nginx configuration
server {
    listen 80;
    server_name api.raikou.me;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}
  1. Install and configure SSL with Certbot
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d api.raikou.me
  1. Start the application with PM2
npm install pm2 -g
pm2 start src/index.js --name mc-server-api
pm2 save
  1. Enable PM2 startup script
pm2 startup

Environment Variables

Create a .env file in the root directory:

# Server Configuration
PORT=3000
NODE_ENV=production

# Rate Limiting
RATE_LIMIT_WINDOW=60000  # 1 minute in milliseconds
RATE_LIMIT_MAX=60        # 60 requests per minute

# API Settings
API_VERSION=v1
BASE_URL=https://api.raikou.me

# Timeouts (in milliseconds)
JAVA_TIMEOUT=5000
BEDROCK_TIMEOUT=5000
DNS_TIMEOUT=3000

# Cache Settings
CACHE_ENABLED=true
CACHE_TTL=300000        # 5 minutes in milliseconds

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions, issues and feature requests are welcome! Feel free to check issues page.

⭐ Show your support

Give a ⭐️ if this project helped you!

About

Fast and reliable Minecraft server status checker API for both Java and Bedrock editions. Get real-time information about any Minecraft server including player count, version, MOTD, and more.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published