API Documentation

Integrate Moonlit Credit into your own Discord bots and applications. Complete reference for the public and authenticated API endpoints.

Getting Started

The Moonlit Credit API allows third-party bots to connect to our economy, exchange currencies dynamically, and query user data. All requests should be made to our base URL over HTTPS.

BASE_URL: https://api.00000911.xyz

Authentication

Many endpoints require an API Key. Depending on the endpoint, this is either the global `MOONLIT_API_KEY` (for internal integrations) or a specific Bot API Key (for external bots using the Exchange). Pass your key in the headers of your request:

Headers: { "X-API-Key": "YOUR_API_KEY_HERE", "Content-Type": "application/json" }

Requirement

Important Notice:
Before handing over the registered bot API key, the Moonlit Technical Team will conduct a security check to ensure that the bot is not being used for any malicious purposes. Manual addition of currency to your bot is strictly prohibited, as it can collapse the trading system, cause high currency devaluation, and lead to inflation. Proof of work is required to exchange currencies.(for example how users earn credits based on the time they have been in the server, or how users earn credits based on the number of messages they have sent in the server) Our system will automatically flag high-value transactions, which will then go through manual verification before the exchange is completed.

POST /api/bot-exchange/register

Register a new external bot to participate in the Moonlit Credit Exchange. Requires the master API key for authorization.

Parameter Type Description
admin_id *Body String Discord ID of an authorized Admin
bot_name *Body String Name of the bot application
bot_owner_id *Body String Discord ID of the bot owner
Response (Success): { "success": true, "data": { "bot_id": "1234567890", "name": "My Cool Bot", "api_key": "bot_xyz123abc...", "message": "Store this API key safely!" } }

🌍 Public Endpoints

GET /api/health

Check the status of the API and Discord Bot connection. No authentication required.

{ "status": "ok", "bot": "Moonlit Credit Bot" }
GET /api/stats

Retrieve overall global statistics for the Moonlit Credit economy.

{ "success": true, "data": { "total_users": 1500, "total_points": 500000, "total_mc": 25000000, "current_rate": 1.5, "mc_supply": 25000000, "reserve": 500000, "activity_24h": { "exchanges": 12, "transfers": 45, "redemptions": 3 } } }
GET /api/leaderboard

Get the top public users in the economy.

Query Parameter Type Description
sort String Sort by: mc (default), points, or earned
limit Integer Number of results (default 10)
{ "success": true, "data": [ { "user_id": "9876543210", "points": 1500, "moonlit_credits": 1000000, "total_earned": 1200000 } ] }

💱 Bot Exchange Endpoints

GET /api/bot-exchange/rate

Get the current dynamic exchange rate mapping M$ to the external forex pool.

{ "success": true, "data": { "current_rate": 0.957, "external_pool": 1050000, "mc_pool": 980000, "history": [ { "rate": 1.0, "timestamp": "..." } ] } }
POST /api/bot-exchange/buy

For external bots: Convert an external bot currency into Moonlit Credits (M$) for a specific user.

Parameter Type Description
X-API-Key *Header String Your provisioned Bot API Key
user_id *Body String Discord ID of the user receiving M$
external_amount *Body Float Amount of external currency being spent
{ "success": true, "data": { "user_id": "1234567890", "external_spent": 500, "mc_received": 475," "fee_mc": 25, "rate": 1.0, "new_pool_rate": 0.98, "transaction_id": "buy_abc123..." } }
POST /api/bot-exchange/sell

For external bots: Burn a user's Moonlit Credits (M$) to give them your bot's external currency.

Parameter Type Description
X-API-Key *Header String Your provisioned Bot API Key
user_id *Body String Discord ID of the user selling M$
mc_amount *Body Integer Amount of M$ being spent/burned

👤 User Integration Endpoints

GET /api/user/<user_id>

Get detailed information about a specific user account.

Parameter Type Description
X-API-Key *Header String Master Moonlit API Key
user_id *Path String Discord User ID
{ "success": true, "data": { "user_id": "1234567890", "points": 50, "moonlit_credits": 15000, "account_type": "moonlit", "account_name": "Moonlit", "moonlit_plus_member": false, "fees": { "exchange_fee": 0.035, "transfer_fee": 0.18 } } }