Docs/API Reference/Post Bot Stats

Post Bot Stats

Update your bot's server count, shard count, and user count.

Update your bot's statistics on DiscordForge. This is the primary way to keep your bot's server count and other metrics up to date.

POSThttps://discordforge.org/api/bots/stats

Rate Limit

1 request per 5 minutes. We recommend posting stats once on bot startup and then every 30 minutes.

Headers

1Authorization: <YOUR_API_KEY>
2Content-Type: application/json

Request Body

1{
2 "server_count": 1500, // Required – total servers
3 "shard_count": 5, // Optional – total shards
4 "user_count": 50000, // Optional – total users
5 "voice_connections": 10 // Optional – active voice connections
6}

SDK Usage

post-stats.ts
1import { ForgeClient, AutoPoster } from "discordforge-sdk";
2 
3const forge = new ForgeClient(process.env.FORGE_API_KEY, process.env.FORGE_BOT_ID);
4 
5// Post on startup
6await forge.postStats({
7 serverCount: client.guilds.cache.size,
8 shardCount: client.shard?.count ?? 1,
9 userCount: client.users.cache.size,
10});
11 
12// Auto-post every 5 minutes (uses discord.js client)
13const poster = new AutoPoster(forge, client);
14poster.on("post", (stats) => console.log(`Posted: ${stats.serverCount} servers`));