Prerequisite: Please ensure you have an up-to-date version of Node.js (v18 or higher) installed before proceeding.
.env.local file is located) and run the following command:
http://localhost:3000.
Using a Custom Port
By default, Next.js uses port 3000. You can use a different port by adding the--port flag. For example, to run the project on port 3333, use this command:
API Integration and Development
Crafter offers a powerful API for managing your server data and creating custom integrations. You can explore all API endpoints and models through the Swagger interface.Detailed API Documentation
Visit the Swagger interface to see all API endpoints, required parameters, and response models.
Important: Origin Header Requirement
For security reasons, theOrigin header must be present in all requests sent to the Crafter API. The value of this header should be the address of the website making the request. Otherwise, your request will be rejected by the API.
Example 1: Fetching Site Information
Below is an example API request using theGET method to fetch site configuration information:
Example 2: License Key Validation
Below is an example API request using thePOST method to check the validity of a license key. As seen in swagger, this endpoint verifies the correctness of the submitted key.
Example 3: User Authentication
Here’s an example of authenticating a user with the API:Best Practices
Error Handling
Error Handling
Always implement proper error handling in your API calls. Check for HTTP status codes and handle edge cases appropriately.
Rate Limiting
Rate Limiting
Be mindful of API rate limits. Implement caching strategies and avoid making excessive requests in short periods.
Security
Security
- Never expose your API keys or license keys in client-side code
- Always use environment variables
- Implement proper CORS policies
- Use HTTPS for all API communications
API Reference
Authentication API
User authentication and authorization endpoints
Payment API
Payment processing and transaction management
Store API
Product management and store operations
Player API
Player data and server integration
Need Help?
Join Our Developer Community
Get technical support and discuss API integration with other developers.

