Documentation
Everything you need to integrate PikStats into your game.
Overview
PikStats gives your game a hosted backend for player stats, leaderboards, and variables โ no server required. Each game project gets its own SDK key and a set of typed variables. Your game calls the REST API to read and write player data. Every paid call consumes PIKE from your balance.
Quick Start
- Create a game in Games and copy its SDK key.
- Add variables for the values you want to track (score, level, skinโฆ). Copy each variable's token.
- Set variables to Live when ready for production.
- Call
POST /api/player/setwhenever a value changes. - Call
GET /api/leaderboardto show rankings in-game.
Variable token โ 32-character ID for a specific variable. Copy it from the Variables page.
Choose your integration
Variables
A variable is a typed field attached to a game. Every player gets their own value per variable. You define name, type, and default โ PikStats stores the rest.
- One schema per game โ all players share the same variable definitions.
- Each variable has a unique 32-character token used in API calls.
- Variables start in Demo mode and must be manually set to Live.
Variable Types
| Type | Description | Example |
|---|---|---|
| bool | True / false flag | false |
| int | Whole number โ scores, coin count | 0 |
| float | Decimal โ times, ratios | 0.0 |
| text | String โ names, tags, skins | default |
| date | Date in YYYY-MM-DD | 2026-01-01 |
Type casting is automatic โ send any value and PikStats casts it to the variable's type.
Demo & Live Mode
Every variable starts in Demo mode so you can freely edit or delete it. When ready, click Go Live to lock it for production.
Only Live variables are accessible via the API. Demo variables are invisible to game clients.
Plans
| Plan | Games | Variables / game | Starting PIKE |
|---|---|---|---|
| Starter | 1 | 1 | 1,000 |
| Basic | 3 | 5 | +20,000 on upgrade |
| Pro | 10 | 10 | +100,000 on upgrade |
PIKE is consumed by paid API calls. Top up anytime from Buy PIKE.
Authentication
Base URL: https://pikstats.com/api/
Every API request must include your game's SDK key as a header. Find it on the game's page in your dashboard.
X-SDK-Key: your-sdk-key
All responses use the same envelope: {"ok": true, "data": {...}}
| Endpoint | Method | PIKE cost |
|---|---|---|
/api/player/identify | POST | Free |
/api/player/set | POST | 1 PIKE |
/api/player/get | GET | Free |
/api/leaderboard | GET | 1 PIKE |
/api/variables | GET | Free |
Error Handling
The API never returns an error to your game. If something goes wrong โ invalid variable token, insufficient PIKE, player not found โ the API returns ok: true with sensible defaults (empty values, zero PIKE remaining, empty leaderboard).
All failures are silently logged as alerts in your dashboard so you can investigate without your players noticing anything.
Billing & Refunds
All purchases are non-refundable. This includes PIKE packs and extension upgrades. Once applied to your account, credits cannot be reversed. PIKE spent on API calls is also non-refundable.
If you believe you were charged in error, contact support.