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

# Update a bot's server count

POST https://fluxerlist.com/api/v1/bots/{id}/stats
Content-Type: application/json

Sets the server count shown on a bot's listing. The API key must belong to the bot's owner or to a developer listed on the bot.

Call this on a schedule from your bot, for example every 30 minutes, rather than on every guild join or leave. Limited to 12 requests/hour per key.


Reference: https://docs.fluxerlist.com/api/endpoints/bots/update-bot-stats

## Authentication

- `Authorization` header (bearer token, required) — A FluxerList API key. Keys start with `fl_`.

## Request

### Path parameters

- `id` (string, required) — The bot's Fluxer bot ID, FluxerList UUID, or listing slug.

### Body (application/json)

This endpoint expects a BotStatsRequest.

- `serverCount` (integer, required) — The number of servers the bot is currently in.

## Response

### 200

The server count was updated.

- `serverCount` (integer, optional) — The server count now shown on the listing.

## Errors

### 400 Bad Request Error

`serverCount` is missing or is not a non-negative integer.

- `error` (string, optional)

### 401 Unauthorized Error

The API key is missing or invalid.

- `error` (string, optional)

### 403 Forbidden Error

The key does not belong to the bot's owner or a listed developer.

- `error` (string, optional)

### 404 Not Found Error

No bot matches the ID.

- `error` (string, optional)

### 429 Too Many Requests Error

The key is rate limited. Wait for the number of seconds in the `Retry-After` header before retrying.

- `error` (string, optional)
- `remaining` (integer, optional)
- `reset` (integer, optional, nullable) — Unix timestamp in milliseconds for when the limit resets.

## Examples

**Request**

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

**Response**

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

**SDK Code**

```python Bots_updateBotStats_example
import requests

url = "https://fluxerlist.com/api/v1/bots/1473704049217327447/stats"

payload = { "serverCount": 12345 }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Bots_updateBotStats_example
const url = 'https://fluxerlist.com/api/v1/bots/1473704049217327447/stats';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"serverCount":12345}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Bots_updateBotStats_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://fluxerlist.com/api/v1/bots/1473704049217327447/stats"

	payload := strings.NewReader("{\n  \"serverCount\": 12345\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Bots_updateBotStats_example
require 'uri'
require 'net/http'

url = URI("https://fluxerlist.com/api/v1/bots/1473704049217327447/stats")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"serverCount\": 12345\n}"

response = http.request(request)
puts response.read_body
```

```java Bots_updateBotStats_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://fluxerlist.com/api/v1/bots/1473704049217327447/stats")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"serverCount\": 12345\n}")
  .asString();
```

```php Bots_updateBotStats_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://fluxerlist.com/api/v1/bots/1473704049217327447/stats', [
  'body' => '{
  "serverCount": 12345
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Bots_updateBotStats_example
using RestSharp;

var client = new RestClient("https://fluxerlist.com/api/v1/bots/1473704049217327447/stats");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"serverCount\": 12345\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Bots_updateBotStats_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["serverCount": 12345] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://fluxerlist.com/api/v1/bots/1473704049217327447/stats")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```