> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fluxerlist.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fluxerlist.com/_mcp/server.

# Sync your bot's server count

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](/api-quickstart) from the bot's owner or from a developer listed on the bot. Co-developers can use their own keys.

## The endpoint

```text
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.

```json
{ "serverCount": 12345 }
```

`serverCount` must be a non-negative integer. On success you get the stored value back. Full details are in the [API reference](/api/endpoints/bots/update-bot-stats).

## 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](/api-quickstart#rate-limits)).

**`JavaScript`**

```javascript title="JavaScript"
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);
```

**`Python`**

```python title="Python"
import os
import requests

ENDPOINT = f"https://fluxerlist.com/api/v1/bots/{os.environ['BOT_ID']}/stats"

def post_server_count(server_count: int) -> None:
    res = requests.post(
        ENDPOINT,
        json={"serverCount": server_count},
        headers={"Authorization": f"Bearer {os.environ['FLUXERLIST_KEY']}"},
        timeout=10,
    )
    if not res.ok:
        print(f"FluxerList stats failed ({res.status_code}): {res.text}")
```

**`curl`**

```bash title="curl"
curl -X POST "https://fluxerlist.com/api/v1/bots/$BOT_ID/stats" \
  -H "Authorization: Bearer $FLUXERLIST_KEY" \
  -H "Content-Type: application/json" \
  -d '{"serverCount": 12345}'
```

## Troubleshooting

#### I get 403 Forbidden

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.

#### I get 404 Bot not found

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

#### I get 400

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

#### I get 5xx errors or timeouts

FluxerList may be having problems. Check the [status page](https://status.fluxerlist.com). Your scheduled post will retry on its own next time, so there's no need to retry in a tight loop.

#### The number on my card didn't change

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