Back to Home
API Documentation
Integrate FindMeABot listing stats, fetch developer databases, and automatically update your bot's live server count using our API.
POST
/api/bots/:id/statsToken RequiredPost statistics (server count and user count) for your bot. Requires an API token generated from your bot settings panel. You can supply either 'servers' or 'users', or both.
Headers
| Header | Value | Description |
|---|---|---|
| Authorization | Bearer <token> | Your secret bot API token. |
| Content-Type | application/json | Must be set to application/json. |
JSON Body Schema
{
"servers": 1420,
"users": 850300
}JSON Response
{
"success": true,
"servers": 1420,
"users": 850300
}Code Samples
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers] });
client.on('ready', async () => {
console.log(`Logged in as ${client.user.tag}!`);
// Post stats
try {
const response = await fetch(
`https://findmeabot.com/api/bots/${client.user.id}/stats`,
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
servers: client.guilds.cache.size,
users: client.users.cache.size, // Note: depends on client caching / guild members intents
}),
}
);
const data = await response.json();
console.log('Stats updated successfully:', data);
} catch (error) {
console.error('Error posting stats:', error);
}
});
client.login('YOUR_DISCORD_BOT_TOKEN');