PiStatsAPI setup

What it is

PiStatsAPI is a lightweight plugin for Paper/Spigot servers that exposes read-only stats — player count, playtime, deaths, and more — over a small HTTP API. Your site polls it through a secure proxy to show live status and leaderboards. It never exposes commands or write access to your server.

Install

  1. Drop the PiStatsAPI jar into your server's plugins/ folder and restart.
  2. Open plugins/PiStatsAPI/config.yml and note (or change) the port it listens on.
  3. Expose that port. On a game host (DatHost, Pterodactyl panels, etc.) allocate an additional port in the panel and set it in the config. On a self-hosted box, open it in your firewall.
  4. Restart the server once more so the port change takes effect.

Find your URL

Your endpoint is http://<your-server-host>:<port> — usually the same hostname players connect with, plus the port from the config. Plain http:// is expected; the site proxies every request server-side so visitors always stay on https.

Quick check: open http://<host>:<port>/api/server in a browser. If you see a short JSON blob with an onlinecount, you're good.

Connect it

In your site dashboard, open the Connection tab, paste the URL, hit Save, then Test connection. The moment the test passes, your home page shows the live player count and the Leaderboards page appears in your site's nav.

Troubleshooting

  • Timeout / connection refused:the port isn't reachable from the internet. Re-check the panel allocation or firewall rule, and confirm the plugin logged its listen port on startup.
  • HTTP 404 on some boards:older plugin builds don't serve every stat. Update PiStatsAPI to the latest release.
  • "Private address" error on save:the URL must be your server's public address — local or LAN addresses can't be reached from the site.
  • Stale numbers:stats are cached for ~30 seconds; that's expected.

← Back to overview