A Node.js API for monitoring and retrieving information from Exaroton Minecraft servers
This is a lightweight Node.js API that integrates with the Exaroton service to provide real-time information about Minecraft servers and players. Built for easy deployment on Vercel with serverless functions.
Key Features:
- ๐ฎ Player List - Get real-time list of online players
- ๐ค Player Info - Detailed player statistics and information
- ๐ Serverless - Ready for Vercel deployment
- ๐ CORS Enabled - Ready for web integration
- โก Fast & Reliable - Optimized for performance
# Clone the repository
git clone https://github.com/CachorroninjaBot/Minecraft-API.git
cd exaroton-server-api
# Install dependencies
npm install
# Set up environment variables (see below)
cp .env.example .env
# Start development server
npm startCreate a .env file in the root directory:
EXAROTON_TOKEN=your_exaroton_api_token_hereHow to get your Exaroton token:
- Go to Exaroton Account Settings
- Navigate to API section
- Generate a new API token
- Copy and paste it into your
.envfile
GET /cReturns a list of currently online players.
Response:
{
"default": false,
"mensagem": "Selecione um jogador",
"players": {
"name1": "PlayerName1",
"name2": "PlayerName2",
"enable1": false,
"enable2": false,
// ... up to 25 players
}
}GET /player/{playerName}Get detailed information about a specific player.
Parameters:
playerName- The Minecraft username
Response:
{
"success": true,
"data": {
"name": "PlayerName",
"online": true,
"nickname": "DisplayName",
"balance": "1000.0",
"rank": "Member",
"world": "world",
"clan": "ClanName",
"time_played": "120h 30m",
"auraskills_level": "50"
},
"mensagem": "Player information retrieved successfully"
}Error Response:
{
"success": false,
"error": "Jogador PlayerName nรฃo registrado"
}exaroton-server-api/
โโโ api/
โ โโโ list/
โ โ โโโ index.js # Player list endpoint
โ โโโ player/
โ โโโ index.js # Player info endpoint
โโโ index.js # Main application
โโโ package.json # Dependencies
โโโ vercel.json # Vercel configuration
โโโ .env.example # Environment template
โโโ .gitignore # Git ignore rules
โโโ LICENSE # MIT License
โโโ README.md # This file
// Get online players
const players = await fetch('https://your-api.vercel.app/c')
.then(res => res.json());
// Get specific player info
const playerInfo = await fetch('https://your-api.vercel.app/player/Steve')
.then(res => res.json());import requests
# Get online players
response = requests.get('https://your-api.vercel.app/c')
players = response.json()
# Get player info
response = requests.get('https://your-api.vercel.app/player/Steve')
player_info = response.json()# Get online players
curl https://your-api.vercel.app/c
# Get player information
curl https://your-api.vercel.app/player/SteveThe API is currently configured to work with a specific server. To use it with your server:
- Find your server ID from the Exaroton dashboard
- Replace
b84AUtz8FZXVQ6Xqin the API endpoints with your server ID - Update both
/api/list/index.jsand/api/player/index.js
The API uses a custom playerinfo command. Make sure your Minecraft server has this command available, or modify the code to use standard commands.
The API includes comprehensive error handling for:
- Invalid player names - Returns appropriate error messages
- Server offline - Waits for server to come online
- API rate limits - Implements retry logic
- Network issues - Graceful error responses
- โ Environment variables for sensitive data
- โ Input validation for player names
- โ Error sanitization to prevent information leakage
- โ CORS configuration for web security
Exaroton API has rate limits. This API implements:
- Automatic retry logic
- Intelligent waiting between requests
- Error handling for rate limit exceeded
- Serverless deployment - Zero cold start optimization
- Efficient API calls - Minimized requests to Exaroton
- Proper error handling - Fast failure responses
- Optimized JSON responses - Minimal payload size
Contributions are welcome! Here's how you can help:
- ๐ด Fork the repository
- ๐ Create a feature branch (
git checkout -b feature/amazing-feature) - โ Make your changes
- ๐ Commit your changes (
git commit -m 'Add amazing feature') - ๐ Push to the branch (
git push origin feature/amazing-feature) - ๐ฌ Open a Pull Request
- Keep code clean and well-commented
- Add error handling for new features
- Test all endpoints before submitting
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues:
- Check the Issues section
- Create a new issue with detailed information
- Include error messages and steps to reproduce
Made with โค๏ธ for the Minecraft community
โญ Star this repo โข ๐ Report Bug โข ๐ก Request Feature