Integrate Moonlit Credit into your own Discord bots and applications. Complete reference for the public and authenticated API endpoints.
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.
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:
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.
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 |
Check the status of the API and Discord Bot connection. No authentication required.
Retrieve overall global statistics for the Moonlit Credit economy.
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) |
Get the current dynamic exchange rate mapping M$ to the external forex pool.
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 |
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 |
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 |