Skip to content

CachorroninjaBot/Minecraft-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Exaroton Server API

A Node.js API for monitoring and retrieving information from Exaroton Minecraft servers

Deploy with Vercel

โœจ What is it?

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

๐Ÿš€ Quick Deploy

1-Click Deploy on Vercel

Deploy with Vercel

Manual Setup

# 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 start

๐Ÿ”‘ Environment Variables

Create a .env file in the root directory:

EXAROTON_TOKEN=your_exaroton_api_token_here

How to get your Exaroton token:

  1. Go to Exaroton Account Settings
  2. Navigate to API section
  3. Generate a new API token
  4. Copy and paste it into your .env file

๐Ÿ“– API Endpoints

๐ŸŽฎ Get Online Players

GET /c

Returns 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 Information

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"
}

๐Ÿ—๏ธ Project Structure

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

๐ŸŽฏ Usage Examples

JavaScript/Fetch

// 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());

Python

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()

cURL

# Get online players
curl https://your-api.vercel.app/c

# Get player information
curl https://your-api.vercel.app/player/Steve

๐Ÿ”ง Configuration

Server ID Configuration

The API is currently configured to work with a specific server. To use it with your server:

  1. Find your server ID from the Exaroton dashboard
  2. Replace b84AUtz8FZXVQ6Xq in the API endpoints with your server ID
  3. Update both /api/list/index.js and /api/player/index.js

Custom Player Command

The API uses a custom playerinfo command. Make sure your Minecraft server has this command available, or modify the code to use standard commands.

โš ๏ธ Error Handling

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

๐Ÿ›ก๏ธ Security Features

  • โœ… Environment variables for sensitive data
  • โœ… Input validation for player names
  • โœ… Error sanitization to prevent information leakage
  • โœ… CORS configuration for web security

๐Ÿ“Š Rate Limits

Exaroton API has rate limits. This API implements:

  • Automatic retry logic
  • Intelligent waiting between requests
  • Error handling for rate limit exceeded

๐Ÿš€ Performance

  • 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

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒŸ Create a feature branch (git checkout -b feature/amazing-feature)
  3. โœ… Make your changes
  4. ๐Ÿ“ Commit your changes (git commit -m 'Add amazing feature')
  5. ๐Ÿš€ Push to the branch (git push origin feature/amazing-feature)
  6. ๐Ÿ“ฌ Open a Pull Request

Development Guidelines

  • Keep code clean and well-commented
  • Add error handling for new features
  • Test all endpoints before submitting
  • Update documentation as needed

๐Ÿ“„ License

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

๐Ÿ”— Links

๐Ÿ’ก Support

If you encounter any issues:

  1. Check the Issues section
  2. Create a new issue with detailed information
  3. Include error messages and steps to reproduce

Made with โค๏ธ for the Minecraft community

โญ Star this repo โ€ข ๐Ÿ› Report Bug โ€ข ๐Ÿ’ก Request Feature

# Minecraft-API

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published