For developers · API v1

Vote rewards and API

Reward players who vote for your game, check votes on demand, and show your rank on your own site. Everything below is set up per game from your dashboard.

1. Vote link

Send each player to their own vote link. u is your player's id: 1–64 letters, numbers, _ or -. We store it with the vote, never show it publicly, and send it back to you.

https://crownmygame.com/vote/{game-slug}?u={player-ref}

2. Postback

About 10 seconds after a vote passes our fraud checks, we call your postback URL:

POST {your postback URL}
Content-Type: application/json
X-CrownMyGame-Signature: t=1792000000,v1=<hex HMAC-SHA256 of "t.body">

{
  "vote_id": "vt_01J9X4K2M7Q8R3T5V6W8X9Y0Z1",
  "game": "your-game",
  "player_ref": "12345",
  "voted_at": "2026-10-14T14:02:11Z",
  "next_vote_at": "2026-10-15T14:02:11Z",
  "country": "US",
  "test": false
}
  • Verify: compute HMAC-SHA256 of t + "." + raw body with your game's secret and compare it to any v1 value. Reject timestamps more than 5 minutes old.
  • Rotation: for 24 hours after you rotate the secret, the header carries two v1 values, one per secret.
  • Idempotency: credit each vote_id once. A retry can deliver the same vote twice.
  • Retries: answer with any 2xx status. Otherwise we retry at 1 min, 5 min, 30 min, 2 h and 12 h (Free plans retry once), then email you.
  • Test votes have "test": true. Never reward them.
  • Legacy GET: for old scripts, we can instead call ?player_ref=…&vote_id=…&voted_at=…&test=0&t=…&sig=…, where sig is HMAC-SHA256 of t.vote_id.player_ref.

Copy-paste receivers for Node and PHP are on each game's dashboard, with a delivery log and a "Send test vote" button.

3. Pull API

Authenticate with your game's API key: Authorization: Bearer cmg_….

GET /api/v1/votes/check?player_ref=12345
→ { "voted": true, "voted_at": "2026-10-14T14:02:11.000Z", "next_vote_at": "2026-10-15T14:02:11.000Z" }

GET /api/v1/games/{slug}/stats
→ { "game": "your-game", "status": "live", "votes_today": 12, "votes_this_month": 412,
    "ranks": { "monthly": 3, "trending": 2, "rising": null }, "players_online": 312 }

A rank is null until the game has a vote on that board, and Rising only covers games listed in the last 60 days.

Errors: 401 invalid_api_key, 400 invalid_player_ref, 403 key_does_not_match_game.

4. Players online

Report how many players are online, every 1 to 5 minutes. While the count is under 15 minutes old it shows on your listing, in the rankings and in the game finder, where players can sort by it. Your game page also charts the daily peak. It never affects rank.

POST /api/v1/players
Authorization: Bearer cmg_…
Content-Type: application/json

{ "online": 312 }
→ { "ok": true, "online": 312, "shown_until": "2026-10-18T18:15:00.000Z", "shown": true }
  • What to count: players active in the last 15 minutes, or whatever your game itself shows as online. A whole number from 0 to 1,000,000.
  • Form or query string work too: online=312.
  • Rate: reports closer together than 30 seconds get 429 too_frequent.
  • Honesty: admins compare counts with what the game shows. A count that does not match is hidden everywhere, and shown turns false.

Errors: 401 invalid_api_key, 400 invalid_online, 429 too_frequent. Copy-paste reporters for cron, PHP and Node are on each game's dashboard.

5. Badges for your site

Live images that link back to your listing. They update every few minutes.

<a href="https://crownmygame.com/vote/{game-slug}"><img src="https://crownmygame.com/badge/{game-slug}.svg?style=vote" width="220" height="56" alt="Vote for us on CrownMyGame"></a>
<a href="https://crownmygame.com/game/{game-slug}"><img src="https://crownmygame.com/badge/{game-slug}.svg" width="220" height="56" alt="Our rank on CrownMyGame"></a>

Rules

Reward the vote, never ad clicks, and give every voter the same reward. Games that buy or fake votes lose them, and repeat offenders are delisted. How the ranking works