Reward your players' votes

Three ways to connect CraftRank to your server. Pick the one that fits your plugin: they can also be combined.

1. Votifier (NuVotifier)

Install NuVotifier on your server (or on your BungeeCord / Velocity proxy), then your favourite reward plugin. In your server form, “Vote rewards” section:

  • Host : your server's public address (no http://).
  • Port : NuVotifier's port (8192 by default), open at your host.
  • Token : plugins/Votifier/config.yml → tokens: default: (protocol v2, recommended).
  • Or public key : plugins/Votifier/rsa/public.key for the old Votifier or a forwarder that only supports protocol v1.

The protocol is picked automatically: v2 with the token if your server offers it, otherwise v1 with the public key. The “Send a test vote” button checks everything in one click. Bedrock players (Geyser / Floodgate) are sent with their username, dot included.

2. HTTP API

Create an API key in your server form. Keep it secret: only use it from your server, never in a web page. The key can be sent as the key parameter or in the Authorization: Bearer header.

Did they vote?

GET https://craftrank.fr/api/v1/vote/check?key=VOTRE_CLE&username=Steve

{ "voted": true, "claimed": false, "voted_at": 1759480000000, "next_vote_at": 1759566400000 }

Give the reward only once

Returns claimed: true only once per vote: you cannot reward the same vote twice.

GET https://craftrank.fr/api/v1/vote/claim?key=VOTRE_CLE&username=Steve

{ "claimed": true }                              ← give the reward
{ "claimed": false, "reason": "already_claimed" } ← already rewarded
{ "claimed": false, "reason": "no_vote" }         ← no vote in the last 24 h

Latest votes (for a plugin that polls)

GET https://craftrank.fr/api/v1/votes?key=VOTRE_CLE&since=1759480000000

{ "votes": [ { "username": "Steve", "timestamp": 1759480123000, "claimed": false } ], "now": 1759480200000 }

Skript example

command /voterecompense:
  trigger:
    set {_r} to text from "https://craftrank.fr/api/v1/vote/claim?key=VOTRE_CLE&username=%player%"
    if {_r} contains """claimed"":true":
      give player 1 diamond
      send "&aMerci pour ton vote !"
    else if {_r} contains "already_claimed":
      send "&eRécompense déjà récupérée, reviens demain !"
    else:
      send "&cVote sur craftrank.fr puis refais /voterecompense"

You need a Skript addon that can make HTTP requests: adapt the “set {_r}” line to your addon's syntax.

Limit: 300 requests per minute. A vote counts for 24 h, like on the site.

3. Webhook

Enter a URL in your server form: on each vote, CraftRank calls it with a POST and this JSON body:

POST https://monserveur.fr/craftrank-vote
Content-Type: application/json
X-CraftRank-Signature: sha256=…

{ "event": "vote", "server": { "id": 12, "slug": "mon-serveur", "name": "Mon serveur" }, "username": "Steve", "timestamp": 1759480123000 }

Check the signature to make sure the call comes from CraftRank: it is the HMAC-SHA256 of the raw body, with your API key.

// Node.js
const sig = 'sha256=' + crypto.createHmac('sha256', CLE_API).update(rawBody).digest('hex');
if (!crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(req.get('X-CraftRank-Signature') || ''))) return res.sendStatus(401);

// PHP
$sig = 'sha256=' . hash_hmac('sha256', file_get_contents('php://input'), CLE_API);
if (!hash_equals($sig, $_SERVER['HTTP_X_CRAFTRANK_SIGNATURE'] ?? '')) { http_response_code(401); exit; }

Reply with a 2xx code within 8 seconds (redirects are followed). The test vote in the form also sends a call with "event": "test". The result of the last call is shown under the webhook field.

Show votes in a Discord channel

Paste a Discord webhook URL directly (Channel settings → Integrations → Webhooks → New webhook → Copy URL): CraftRank posts a message in the channel for every vote, with the player's name and the month's vote count. Nothing to code.

Add my server