Skip to navigation

Sync your bot's server count

Beta
Post your bot's guild count to FluxerList on a schedule so the number on your listing stays honest.
View as Markdown

Bot cards show how many servers a bot is in, when the developer chooses to share it. This guide keeps that number current from your bot’s own code.

You’ll need an API key from the bot’s owner or from a developer listed on the bot. Co-developers can use their own keys.

The endpoint

POST https://fluxerlist.com/api/v1/bots/{id}/stats

{id} can be your bot’s Fluxer bot ID, its FluxerList UUID, or its listing slug. The body is a single field.

{ "serverCount": 12345 }

serverCount must be a non-negative integer. On success you get the stored value back. Full details are in the API reference.

Post on a schedule

Post every 30 minutes or so. Posting on every guild join and leave adds requests without making the number meaningfully more accurate, and this endpoint is capped at 12 requests/hour per key (see Rate limits).

const ENDPOINT = `https://fluxerlist.com/api/v1/bots/${process.env.BOT_ID}/stats`;
async function postServerCount(serverCount) {
const res = await fetch(ENDPOINT, {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FLUXERLIST_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ serverCount }),
});
if (!res.ok) {
const { error } = await res.json().catch(() => ({}));
console.error(`FluxerList stats failed (${res.status}): ${error}`);
}
}
// `guilds` is however your bot library exposes its server list
setInterval(() => postServerCount(guilds.size), 30 * 60 * 1000);
postServerCount(guilds.size);

Troubleshooting

The key isn’t tied to the bot’s owner or a listed developer. Use the owner’s key, or ask the owner to add you as a co-developer on the listing. Bots can have up to 5.

Double-check the ID. It should match the bot’s Fluxer bot ID, FluxerList UUID, or listing slug.

serverCount must be a whole number of 0 or more. Strings such as "12345" are rejected, so send a number.

FluxerList may be having problems. Check the status page. Your scheduled post will retry on its own next time, so there’s no need to retry in a tight loop.

The listing only shows a server count if you’ve chosen to share it. Check your bot’s edit page.