Game server API
Base address: https://votescript.voterank.net/index.php?r=api/v1/
Send your key in the X-Api-Key header, or as Authorization: Bearer. Parameters go in the query string (GET), a form body or a JSON body (POST). Answers are JSON.
| Method | Request | What it does |
|---|---|---|
ping | GET | Checks the key |
check | GET player | Shows what is waiting, claims nothing |
claim | POST player, ref | Returns everything waiting and marks it claimed |
claim-code | POST player, code, ref | Redeems one code (code mode) |
top | GET | This month’s top 25 voters |
pending | GET limit, players | Players with something to claim, for automatic payout. players=A,B,C (up to 200) asks only about these, such as who is online |
votifier | POST service, player, time, ref | Reports a vote received over Votifier |
format=text on claim and claim-code answers ok, a tab and the number of votes, then one line per item: key, amount and name, separated by tabs.
Claim
curl -X POST -H "X-Api-Key: YOUR_KEY" \ -d player=Zezima -d ref=A-NEW-UUID \ "https://votescript.voterank.net/index.php?r=api/v1/claim"
{
"ok": true,
"player": "Zezima",
"ref": "5f0c2c1e-…",
"votes": 2,
"items": [{"key": "995", "name": "Coins", "amount": 1000000}],
"grants": [
{"id": 41, "reason": "vote", "site": "VoteRank", "time": 1795600000,
"items": [{"key": "995", "name": "Coins", "amount": 500000}]}
]
}| Field | Meaning |
|---|---|
items | The total to hand out |
votes | The number of votes behind it, if you prefer your own prizes |
grants | Each reward on its own. reason is vote, all (voted on every site), streak or gift |
ref | 8 to 64 letters, digits, - or _. Use a new one for every command a player types. If the request times out, repeat it with the same one: the same rewards come back and nothing is paid twice |
Nothing waiting: ok is true with empty lists. Names ignore case, and treat space, _ and - as equal.
Reward types
A key without a slash is an item, a currency or a word. Other rewards have a type before the slash.
| Key | Amount | Meaning |
|---|---|---|
vip/NAME | days | VIP or premium time. Adds up |
group/NAME, permission/NAME | days | Or …/forever |
title/NAME, unlock/NAME | days | Or …/forever. _ in a title is a space |
teleport/PLACE or teleport/X,Y,Z | 1 | Last, and once per claim |
storage/ID | number | Added to the value. storage/ID/VALUE sets it |
until/ID | days | A storage set to a time ahead; extends one that runs |
xp/SKILL | number | Experience |
boost/NAME/PERCENT | minutes | Such as boost/experience/50 |
effect/NAME | seconds | |
outfit/ID,ADDONS, mount/ID, spell/ID, badge/ID | 1 | Once |
run/NAME | number | An action defined on the game server |
custom/ANYTHING | number | For your own code |
Send types with claim, claim-code, check and pending: what your game can do, such as item,vip/gold,storage/30000-39999,xp. A type alone covers everything of that type. Rewards with anything else stay waiting, and held says how many. Without types everything is handed out. Check every part of a key before you use it, and never run it as a command or code.
Each item also has type and text, such as “VIP for 1 day”. In the text format, held follows the votes when types was sent.
Codes
claim-code answers {"ok": false, "status": "unknown"}, "used" or "held" (see reward types) when the code cannot be redeemed. Dashes, spaces and case do not matter.
Errors
Errors look like {"ok": false, "error": "…"}.
| HTTP | Meaning |
|---|---|
401 | The key is missing or wrong |
405 | Use POST |
422 | A parameter is missing or not valid |
429 | Slow down |
500 | Retry with the same ref |
Public API
Base address: https://votescript.voterank.net/index.php?r=api/public/YOUR-SERVER/
Reading is open to every website and needs no key.
| Method | Parameters | Returns |
|---|---|---|
server | Texts, look, sites with images, rewards, content | |
top | period day, week, month, all; limit up to 100 | players |
stats | votes: today, week, month, all, voters_month | |
recent | limit up to 50 | votes |
player | player; header X-Voter in code mode | Wait per site, items to claim, streak |
vote | POST site, player, voter | url to send the player to |
Limits per address in 5 minutes: 600 requests, or 6,000 with a key.
<script src="https://votescript.voterank.net/embed.js" async defer></script>
<script>
addEventListener('load', async () => {
const vs = VoteScript.api('your-server');
const { players } = await vs.top({ period: 'month', limit: 10 });
});
</script>Start a vote
Returns the address to send the player to. From a browser it works on your allowed websites; from a server, send your API key.
curl -X POST 'https://votescript.voterank.net/index.php?r=api/public/your-server/vote' \
-H 'X-Api-Key: YOUR_KEY' -H 'Content-Type: application/json' \
-d '{"site":"voterank","player":"Zezima"}'voter is 48 characters 0-9 a-f, random, kept by the visitor’s browser. In code mode it proves who earned a code.
Open the toplist in a new tab: toplists do not work inside frames. Open the tab in the click itself and set its address afterwards, or browsers block it.
Webhooks
One POST per counted vote. X-VoteScript-Signature is sha256= and the HMAC-SHA256 of the raw body with your signing secret. Ignore an id you have already handled. Answer with any 2xx; otherwise it is retried for about a day.
{"event":"vote","id":"…","server":"your-server","time":1795600000,
"player":"Zezima","site":{"slug":"voterank","name":"VoteRank"},
"vote_id":41,"voted_at":1795600000,
"items":[{"key":"995","name":"Coins","amount":100000}]}Items are for display. Players still claim them, or your delivery program does, so do not pay them twice.
The same votes can be sent to a Votifier or NuVotifier in your game, see Send votes to your Votifier.
Embed attributes
| Attribute | What it does |
|---|---|
data-server | The address of your server. Required |
data-mode | inline or button, which opens the list on top of the page |
data-label | Text of the button |
data-block | top, recent, count, goal or sites instead of the vote list |
data-period | day, week, month or all |
data-limit | Number of rows |
data-goal | Number of votes for goal |
data-title | Heading of a block |
data-theme | auto, light or dark |
data-player | Fills in the name of a player who is logged in on your site |
data-callback | JavaScript function called after a confirmed vote. For display only |
data-style | none: plain HTML with vs- classes instead of a frame |
What callbacks are answered
| HTTP | Meaning |
|---|---|
200 | Counted, duplicate, ignored, captured or test; the text says which |
403 | Wrong callback URL, secret, signature or sender |
405 | Wrong method |
500 | VoteScript failed; the list should try again |

