Resources
API Documentation
TOPSPAWN public API v1
The TOPSPAWN API allows server owners to verify votes and automatically reward players via plugins on their game servers.
Quick start
- 1Generate your API key in the Dashboard → Vote kit
- 2
Test with curl:
curl -H "Authorization: Bearer your_key" https://www.topspawn.com/api/v1/server/info - 3Integrate into your Minecraft, FiveM, or any other game server plugin
Authentication
All requests must include your API key via the Authorization header:
Authorization Header
curl -H "Authorization: Bearer ts_live_YOUR_KEY" \
https://www.topspawn.com/api/v1/server/infoRate limit: 60 requests per minute per API key. If exceeded, the API returns a 429.
Responses: never cached (Cache-Control: no-store). Every error carries a stable code field (e.g. already_claimed, invalid_within) besides the error message.
Delay between two votes: 2 hours. A player can vote for your server once every 2 hours, per account, per connection and per in-game username. Set your vote module's delay to 2 h.
Endpoints
/api/v1/vote/checkThe oldest vote of this player for your server not claimed yet (/vote/claim), with its vote_id and the number of pending votes (unclaimed_count). A vote's in-game username and connection fingerprint are erased once 30 days have passed: an unclaimed vote older than 30 days is no longer found. If the database is not ready, the answer is 503 (retry later). Vote test: when you run « Check my setup » from your vote kit, a vote test of this name may be returned (with test: true and unclaimed_count: 1) when no real unclaimed vote exists: reward it like a vote, it is counted nowhere on TOPSPAWN. It can be found for 30 minutes.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
username | string | no | The player's in-game username (case does not matter). Send username OR ip (400 without either); if both are given, only username is used. |
ip | string | no | The player's IP address (IPv6: its /64 counts as one connection). Window of 120 minutes at most; the answer then has neither username nor time, only voted, vote_id and unclaimed_count (to claim a vote cast without a username). |
within | integer | no | Search window in minutes. With username: 1 to 43200 (30 days, the default). With ip: 1 to 120 (the default). Out of range: 400. |
curl example
curl -H "Authorization: Bearer ts_live_YOUR_KEY" \
"https://www.topspawn.com/api/v1/vote/check?username=Steve&within=1440"Response
{
"voted": true,
"vote_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"voted_at": "2026-03-21T14:30:00.000Z",
"unclaimed_count": 1,
"username": "Steve"
}/api/v1/vote/claimClaims a vote for your server (the reward is yours to give). Idempotent: sending the same request with the same Idempotency-Key gets the same answer (200, header Idempotent-Replayed: true); another key gets 409 (already claimed, e.g. by another of your servers). Unknown, invalidated or older than 30 days: 404. A replay gets the same answer while the vote is less than 30 days old (beyond: 409). A JSON body (an object) is required. A vote test is claimed the same way (answer with test: true).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
vote_id | uuid | yes | The vote_id given by /vote/check (in the JSON body). |
Idempotency-Key | header | yes | Header required with vote_id: 8 to 128 characters (letters, digits, _ . : -), specific to your server and this vote. Never put a player identifier in it (licence, username). |
username | string | no | Former mode (plugin 1.1), deprecated: the player's username instead of vote_id. Answered with the header Deprecation: true; removed 3 months after plugin 1.2 is announced. It also claims a vote test of this name, once (answer with test: true): a 1.1 plugin therefore rewards it once. |
curl example
curl -X POST \
-H "Authorization: Bearer ts_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: monserveur:a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
-d '{"vote_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"}' \
"https://www.topspawn.com/api/v1/vote/claim"Response
{
"success": true,
"vote_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"claimed_at": "2026-03-21T14:31:02.120Z"
}/api/v1/vote/verifyFor your server's website (your own page; Azuriom: automatic check coming soon): was a valid vote cast from this connection for your server within the window? Answer: {"voted": true} or {"voted": false}, nothing else. A separate verification key (ts_verify_…, Dashboard → Vote kit), read-only; the API key is not accepted. Server to server only (no CORS). Limits: 120 requests per minute per key, 60 per minute per calling address and key, 600 per minute per calling address. Redis or the database unavailable: 503. Variant without the IP in the URL: POST with the JSON body {"ip": "…", "within": 120}.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
ip | string | yes | The player's IP address as your website sees it (IPv6: its /64 counts as one connection). A connection can be shared (home router, carrier): the answer is about the connection, not the person. |
within | integer | no | Window in minutes: 1 to 120 (120 by default). Beyond: 400. |
curl example
curl -H "Authorization: Bearer ts_verify_YOUR_KEY" \
"https://www.topspawn.com/api/v1/vote/verify?ip=203.0.113.7&within=120"Response
{
"voted": true
}/api/v1/vote/countReturns your server's vote statistics. votes_monthly counts the valid votes of the current month, since the 1st at 00:00 Paris time. votes_24h and votes_7d count the valid votes of the last 24 hours and the last 7 days (rolling windows; until October 2026: since 00:00 UTC and since Monday 00:00 UTC). A new vote counts at once and leaves the counter at most 5 minutes after its 24 hours or 7 days: both counters can therefore go down at any time. To detect a new vote, use /vote/check or votes_total, never a difference of votes_24h. If a counter cannot be read, the response is a 500 error (try again later), never a 0.
curl example
curl -H "Authorization: Bearer ts_live_YOUR_KEY" \
"https://www.topspawn.com/api/v1/vote/count"Response
{
"votes_total": 1234,
"votes_24h": 42,
"votes_7d": 287,
"votes_monthly": 890,
"server_name": "Mon Serveur",
"server_game": "minecraft"
}/api/v1/server/infoGets your server's public information, with its direct vote link (vote_url, and vote_urls in French and English). The rank counts the servers visible on the site, all games together, sorted by total votes. If the counters or the rank cannot be read, the answer is a 500 error (retry later), never a 0 nor a rank 1.
curl example
curl -H "Authorization: Bearer ts_live_YOUR_KEY" \
"https://www.topspawn.com/api/v1/server/info"Response
{
"name": "Mon Serveur",
"game": "minecraft",
"ip": "play.monserveur.fr",
"port": 25565,
"description": "Un super serveur survie !",
"is_premium": false,
"is_verified": true,
"votes_total": 1234,
"followers_count": 56,
"rank": 12,
"vote_url": "https://www.topspawn.com/fr/serveurs/minecraft/mon-serveur?vote=1",
"vote_urls": {
"fr": "https://www.topspawn.com/fr/serveurs/minecraft/mon-serveur?vote=1",
"en": "https://www.topspawn.com/en/servers/minecraft/mon-serveur?vote=1"
}
}Error codes
| Code | Description |
|---|---|
200 | Success |
400 | Missing or invalid parameter |
401 | Missing or invalid API key |
404 | Resource not found (e.g. no unclaimed vote) |
409 | Vote already claimed with another Idempotency-Key (code already_claimed) |
429 | Rate limit exceeded (60 req/min): retry after the delay of the Retry-After header |
500 | Internal server error |
503 | Service temporarily unavailable (short outage, your key is fine): retry after the delay of the Retry-After header (60 s) |
Plugins & Integrations
Ready-to-use Lua plugin (v1.2) to automatically reward your FiveM players when they vote: designed not to reward the same vote twice, even with several servers on one key or after a restart. Works with ESX, QBCore, QBox; without a framework, through a custom event.
- 1.Download the
topspawn-votesfolder and place it inresources/ - 2.Add
ensure topspawn-votestoserver.cfg - 3.Open
config.luaand paste your API key - 4.Configure the reward type (money, bank, item, custom)
- 5.Restart your server
Vote badge
An image to embed on your website, forum or Discord: your server's rank in its game's ranking (this month's votes), this month's votes and players, refreshed every 5 minutes, linking to your vote page. No API key needed.
https://www.topspawn.com/badge/<server-id>.png?style=button|stats|mini&theme=light|dark&lang=fr|enPick the format and copy the HTML, Markdown, BBCode or Discord code from Dashboard › Vote kit
Ready to integrate?
Generate your API key and start rewarding your players in minutes.
Generate my API key