When to use the API
- Show server or bot stats in a command
- Check whether a user can vote again
- Render review summaries in your own dashboard
- Cache Rankly data in a backend job
Recommended setup
Keep the API key server-side
Store the key in an environment variable. Do not ship it in a browser bundle or public client app.
Call the smallest endpoint you need
Use
/server for server stats, /bot for bot stats, /votes/:userId for cooldown checks, and /reviews for review summaries.Handle failures cleanly
Treat
401, 400, and 429 as normal outcomes and show a useful message instead of crashing the command.Example: fetch server stats
- Node.js
- Python
Example: check vote eligibility
Good integration habits
- Never trust the client with your API key.
- Use the public API for live reads, not for write operations.
- Keep your command output short and readable.
- Cache responses that users ask for repeatedly.
- Add a small error message when the API key is invalid or the cooldown has not expired.
Related docs
Public API Reference
Endpoint details, auth rules, and response examples.
Bot Vote Webhooks
Receive push updates when a vote is processed.