Key and response format
Why the API looks like thisThe API was built a long time ago, when we had much less experience, and some decisions may look odd today: the key is passed right in the URL, errors come either as a string or as an object, and field names are not always consistent. Making everything "nice" now would mean dropping the old methods, and many services already rely on them. So we keep the old format and only add new things without breaking your integrations. Sorry in advance for these quirks. Peace to everyone ✌️
BotStat API returns stats for your bots and lets you start checks in @BotSafeRobot, mailings in @BotManRobot and subscription checks in @BotMembersRobot from your own code.
Base URL
text
https://api.botstat.io
Access key
Get your key in your account: My account → API keys. One key per account; you can reissue it - the old one stops working immediately.
Keep your key secretThe key is passed in the request URL. Do not publish it in public code or put it into client apps - make requests from your own server.
Response format
All responses are JSON. The ok field tells whether the request succeeded, result holds the data or the error text.
json
{
"ok": true,
"result": {
"username": "@examplebot",
"mau": 16962
}
}
Errors
| Response | When |
|---|---|
| {"ok": false, "result": "Key not set"} | No key passed |
| {"ok": false, "result": "Incorrect key"} | The key does not exist, is not a stats key or is blocked |
| {"ok": false, "result": "Bot not found"} | There is no such bot in the BotStat database |
| {"ok": false, "result": "You not owner this bot"} | The bot is not linked to your account |
| {"ok": true, "result": {"is_scam": true}} | The bot is marked as a scam or disabled |
Was this article helpful?
Didn't find the answer? Contact support