Asomiru API v1

Connect your server statistics or vote rewards. Start with one request, then learn how to handle retries and failures in a working plugin.

Make your first request

Start by reading your server's name, player count and map. You do not need a plugin or linked player accounts for this.

  1. Verify ownership of the server on Asomiru and verify your account's email.
  2. Open Asomiru API on the server page, enter your current password and select Enable API and create key.
  3. Save the key in an environment variable or private configuration. It is shown once. You can replace it if you lose it.
Environment variable
bash
export ASOMIRU_API_KEY='paste_your_asmr_key_here'
Request
bash
curl --fail-with-body 'https://api.asomiru.com/v1/server' \
  -H "Authorization: Bearer $ASOMIRU_API_KEY"
Response 200
json
{
  "id": 42,
  "name": "NEVA · Classic Public",
  "game": "cs2",
  "status": "online",
  "address": "play.example.com:27015",
  "players": 18,
  "maxPlayers": 32,
  "map": "de_mirage",
  "version": null,
  "mode": "defuse",
  "activeVotes": 126,
  "systemBonus": null,
  "checkedAt": "2026-10-18T10:00:00.000Z",
  "pageUrl": "https://asomiru.com/ru/servers/42"
}

If you receive this response, the connection works. The remaining examples use the same ASOMIRU_API_KEY variable. Response dates, names and IDs are illustrative.

One key selects one server. Do not add serverId to a request or put another server's ID in an endpoint URL. A network of 50 servers needs 50 keys. One backend can manage them, but keep requests and reward queues separate by server.

Send the key in Authorization: Bearer …. Make requests from a plugin, bot or backend. For a public website widget, use your own backend to fetch and return the necessary fields; never embed the key in visitor-facing JavaScript. A request with an Origin header receives 403 SERVER_SIDE_ONLY.

Choose the player's ID

Reading server status and aggregate statistics requires no player ID. Personal vote checks and rewards require the player to link their game account to Asomiru for this particular server.

Your integration Player reference
CS, CS2, CS:GO, CS:Source, CS 1.6, TF2, Rust, Left 4 Dead The authenticated player's SteamID64: {"kind":"steam","id":"76561198000000001"}.
Minecraft The player's UUID: {"kind":"game","id":"00000000-0000-4000-8000-000000000042"}.
ARK, ARK: Ascended, Valheim SteamID64 with kind: "steam", or another platform's permanent account ID with kind: "game". Use the same method when linking and querying.
An integration that already stores Asomiru IDs {"kind":"asomiru","id":"ASM-1-0000-0042-20"}. The player must already have a working link to this server.

Always send SteamID64 as a string: JavaScript cannot represent such large integers exactly. The API does not accept STEAM_0:…, [U:1:…], profile URLs or nicknames in its place.

Minecraft UUIDs may include or omit hyphens and use either case. The API normalizes them to lowercase UUIDs with hyphens. For other games, game.id is a case-sensitive string of 3–64 ASCII letters, digits, _, :, or -. A changeable nickname is not a suitable identifier.

An Asomiru ID identifies a website account. It is permanent, remains the same after nickname or email changes, and is not a password. You can store it as a reference, but it does not replace linking: entering someone else's Asomiru ID cannot claim that person's votes.

Obtain the game ID from the game's server API after authentication. Do not trust an arbitrary ID entered in chat. A Minecraft proxy or online-mode=false setup needs reliable account authentication in your network before linking; a supplied nickname or offline UUID alone is not proof of identity. The ready-made AsomiruBridge targets Paper/Spigot 1.21.1+, Java 21 and online-mode=true.

Check a vote without awarding anything

Use this method for an “Have I voted?” command, a bot message or a pending-reward count. It does not reserve or acknowledge events.

Request
bash
curl --fail-with-body -X POST 'https://api.asomiru.com/v1/votes/check' \
  -H "Authorization: Bearer $ASOMIRU_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"player":{"kind":"steam","id":"76561198000000001"}}'
Response 200
json
{
  "voted": true,
  "activeVotes": 3,
  "pendingRewards": 1,
  "lastVotedAt": "2026-10-18T10:00:00.000Z"
}
  • voted: at least one vote by this player for this server is still active.
  • activeVotes: the number of those active votes. Each lasts 30 days.
  • pendingRewards: unacknowledged reward events, including events currently held by another delivery.
  • lastVotedAt: the latest active vote's timestamp, or null.

Without an available link, the response is {"voted":false,"activeVotes":0,"pendingRewards":0,"lastVotedAt":null}. Do not award a reward just because voted is true. The same vote can keep that flag true tomorrow. Use individual events instead.

A player may vote for a server once a day and for at most five servers a day. Pending rewards do not bypass these voting limits.

Collect vote rewards

The player links first, then votes. A vote cast before linking remains visible in votes/check while active, but does not create a reward event retrospectively. System bonus votes do not create player rewards either.

The sequence is claim events → save them locally → acknowledge receipt → award from your queue. “Save” means durable storage that survives a plugin restart, not an in-memory array.

1. Claim a batch

Generate a UUID requestId and save it to your database or job file before sending the request. It identifies one batch-claim attempt for one player.

Request
bash
curl --fail-with-body -X POST 'https://api.asomiru.com/v1/rewards/claim' \
  -H "Authorization: Bearer $ASOMIRU_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"player":{"kind":"steam","id":"76561198000000001"},"requestId":"11111111-1111-4111-8111-111111111111"}'
Response 200
json
{
  "delivery": {
    "id": "22222222-2222-4222-8222-222222222222",
    "leaseUntil": "2026-10-18T10:02:00.000Z"
  },
  "events": [
    {
      "id": "33333333-3333-4333-8333-333333333333",
      "type": "server.vote",
      "votedAt": "2026-10-18T10:00:00.000Z",
      "expiresAt": "2026-11-17T10:00:00.000Z"
    }
  ]
}

events[].id identifies a specific vote. delivery.id identifies the batch to acknowledge. requestId is generated by your plugin and identifies the request. These are three separate IDs; do not substitute one for another.

A batch contains up to 20 events for one player. Until leaseUntil, two minutes after batch creation, another delivery cannot claim those events. If no events are available, the response is {"delivery":null,"events":[]}. An unlinked player receives the same response. A 200 response does not necessarily contain a reward.

2. Save the events

Make events[].id a unique key in your own queue. Store the game account, server ID, vote timestamp, expiresAt and award state. Receiving the same event again must find the existing row rather than enqueue another reward.

Workers for one game server must share that queue and uniqueness constraint. Separate jobs and credentials for different servers. One vote creates one event; your plugin decides what items or currency that event earns.

3. Acknowledge durable receipt

After saving the entire batch, call ack before leaseUntil:

Request
bash
curl --fail-with-body -X POST 'https://api.asomiru.com/v1/rewards/ack' \
  -H "Authorization: Bearer $ASOMIRU_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"deliveryId":"22222222-2222-4222-8222-222222222222"}'
Response 200
json
{"acknowledged":true}

Acknowledgement covers the whole batch; partial acknowledgements are not supported. It tells Asomiru to stop delivering those events. It does not say that the player has already received an in-game item.

4. Award from your queue

A player can be offline or have a full inventory. Keep the queued reward and award it when your game supports doing so. API event expiry limits collection from Asomiru; your own rules govern rewards already accepted into durable storage.

For a database balance, record the event ID and change the balance in the same transaction. For an item command, account for a crash between executing the command and marking it complete: blindly repeating it can award twice. The API protects event delivery; handling an ambiguous game action is the plugin's responsibility.

After acknowledging, use a new requestId to claim another batch. Stop on an empty response rather than looping indefinitely. Login checks, a player command and a 30–60-second poll for online players are usually enough.

Recover from failures

Situation Next step
claim times out and you do not know the result Repeat the same body with the same saved requestId. Do not generate a new ID for every network retry.
A received vote ID already exists in your queue Keep the existing row. Acknowledge after the entire batch is saved.
Two workers call claim concurrently One active delivery holds its batch. Another request may receive an empty response or a different available batch. Event IDs must still be unique in your queue.
Restart after saving events but before ack Restore the job with its original requestId, repeat claim, then acknowledge.
The ack response is lost Repeat ack with the same deliveryId. An acknowledged delivery returns acknowledged: true again while its record exists.
409 LEASE_EXPIRED Keep your local queue, create a new requestId and claim again. Still-available votes retain their event IDs.
Repeating claim returns nothing after a successful ack Expected: the batch is acknowledged. Process rewards from your saved queue.
409 REQUEST_ID_REUSED That request ID belongs to another player. Fix job storage; do not use a single ID for every player.
404 DELIVERY_NOT_FOUND on ack The delivery is no longer available, for example because the link was removed or the delivery record expired. Stop retrying that acknowledgement, check the link and start a new claim.
409 DELIVERY_CHANGED The batch no longer matches. Claim available events with a new requestId and retain local event deduplication.

Uncollected events remain available for up to 30 days after the vote. Delivery records last two days from creation. Removing a link removes its uncollected events. Disabling the API, transferring server ownership or changing recipient details requires new links. Unlinking or replacing Steam invalidates the old Steam link.

Rotating only the key preserves links and pending events. Update every worker: the old key stops working immediately. Removing a website link cannot erase a reward that your plugin has already saved locally.

Server status, statistics and charts

Display the current map or player count

Use GET /v1/server from the first example. Minecraft returns its version in version and map: null. Other games return their map in map. Unknown values are null.

status: "offline" means the monitor did not receive a response; players is then 0. Check status and checkedAt before displaying the player count. activeVotes is the current rating, including an active system bonus. systemBonus is either null or an object containing source, reason, amount, grantedAt, expiresAt and active.

Read a period's totals

Request
bash
curl --fail-with-body 'https://api.asomiru.com/v1/server/stats?period=week' \
  -H "Authorization: Bearer $ASOMIRU_API_KEY"
Response 200
json
{
  "serverId": 42,
  "period": "week",
  "since": "2026-10-11T10:00:00.000Z",
  "until": "2026-10-18T10:00:00.000Z",
  "connectClicks": {"total":245,"uniqueBrowsers":173},
  "votes": {"received":64},
  "reportedJoins": 312,
  "players": {"average":17.42,"peak":32},
  "monitoring": {"samples":2016,"onlineSamples":1982,"availabilityPercent":98.31},
  "generatedAt": "2026-10-18T10:00:00.000Z"
}
Field Meaning
connectClicks.total Website Join clicks, including guests. Repeats from one browser on one server within 30 seconds are combined. These are not verified game logins.
connectClicks.uniqueBrowsers An approximate count of distinct browsers based on request characteristics, not an exact number of people or accounts.
votes.received Player votes received during the period, excluding system bonuses.
reportedJoins Joins reported by your plugin. This is 0 if you do not report them.
players.average / peak Average and peak players from successful monitor checks. null without successful checks.
monitoring.samples / onlineSamples All stored checks and the checks that received a server response.
monitoring.availabilityPercent Successful checks as a percentage of all checks. null without samples. This is a sampled estimate, not second-by-second uptime.

period=day covers the last 24 hours, week covers 7 days, and month covers 30 days. The default is week. These are rolling windows, not calendar days or months. Read since and until for the actual boundaries.

Build a chart

Request
bash
curl --fail-with-body 'https://api.asomiru.com/v1/server/history?period=day' \
  -H "Authorization: Bearer $ASOMIRU_API_KEY"
A single illustrative point
json
{
  "serverId": 42,
  "period": "day",
  "bucket": "hour",
  "since": "2026-10-17T10:30:00.000Z",
  "until": "2026-10-18T10:30:00.000Z",
  "points": [
    {"at":"2026-10-17T10:00:00.000Z","connectClicks":12,"votes":2,"reportedJoins":18,"averagePlayers":17.5,"peakPlayers":24,"samples":6,"onlineSamples":6}
  ],
  "generatedAt": "2026-10-18T10:30:00.000Z"
}

The example shows one point; the real response covers the entire requested window. day uses UTC hours; week and month use UTC days. at marks the start of a bucket, so the first point can precede since: its values include only the part inside the requested window. The last bucket can also be partial.

Intervals without events contain zero counts. Missing player samples produce null, not zero players. Convert UTC timestamps to your interface's timezone when displaying them. Statistics and history are cached for 30 seconds; refreshing once a minute is usually enough.

Report game joins

Use this method to compare website clicks with logins observed by your game server. It sends no player list and does not track playtime.

Suppose your plugin counted seven successful joins in a minute. Save the count, timestamp and a new UUID eventId as one batch, then submit it:

Request
bash
curl --fail-with-body -X POST 'https://api.asomiru.com/v1/server/joins' \
  -H "Authorization: Bearer $ASOMIRU_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"eventId":"66666666-6666-4666-8666-666666666666","count":7,"occurredAt":"2026-10-18T10:00:00.000Z"}'
Response 200
json
{"recorded":true,"duplicate":false,"eventId":"66666666-6666-4666-8666-666666666666"}

Use your batch's current timestamp and a new UUID in real requests. On retry, keep eventId, occurredAt and count unchanged. The response will contain duplicate: true without adding joins again.

A batch contains 1–1000 joins. Send nothing for zero. Its timestamp must be within the last 24 hours; clock skew of up to five minutes ahead is accepted. The limit is 10 requests per minute per server. Split larger counts into separate batches with different IDs and send them gradually. Do not repeatedly submit a cumulative daily counter: the API adds each batch.

A batch older than 24 hours is rejected even with its original eventId; keep it separately if your own statistics need it. 409 EVENT_ID_REUSED means the same ID was used with a different count or timestamp.

Count a join after successful game authentication. Reconnecting counts as another join; this method does not identify unique players. Reports are kept for 31 days and do not affect the server's rating. Owner-reported counts are not used as verified attendance.

Client library and durable queue example

For Node.js, download the Asomiru SDK and extract asomiru-sdk beside your code. The client needs Node.js 22+; its SQLite example needs 22.13+. No additional npm packages are required.

Server status and vote check
javascript
import { AsomiruClient } from './asomiru-sdk/index.mjs';

const api = new AsomiruClient(process.env.ASOMIRU_API_KEY);
const server = await api.server();
console.log(`${server.name}: ${server.players}/${server.maxPlayers}`);

const player = { kind: 'steam', id: '76561198000000001' };
const votes = await api.votes(player);
console.log(`Pending events: ${votes.pendingRewards}`);

Start reward collection with asomiru-sdk/examples/rewards.mjs. It creates a SQLite inbox, persists requestId, inserts unique events and acknowledges the batch. Run it from a terminal:

Collect events for one player
bash
export ASOMIRU_PLAYER_KIND='steam'
export ASOMIRU_PLAYER_ID='76561198000000001'
node asomiru-sdk/examples/rewards.mjs

Set ASOMIRU_API_KEY as shown at the start of this guide. The queue is stored in asomiru-<server ID>.sqlite in your current directory. Repeated runs use the same queue. This example collects events, not in-game items: implement your game's award worker for the votes table, with an award state and duplicate protection.

The client retries a safe request once after a network failure or a temporary 502/503/504 without Retry-After, preserving the body and IDs. link() is not automatically retried. A response with Retry-After produces an AsomiruError containing status, code and retryAfter in seconds. Reschedule the job after that delay rather than blocking the game's main thread.

Minecraft integrations can use AsomiruBridge and its source. The event delivery workflow is not Minecraft-specific and works for plugins in other games too.

Methods and parameters

All paths below start with https://api.asomiru.com/v1. POST requests need Content-Type: application/json. Every listed method returns 200 on success.

Method Parameters Result
GET /server None. Your server's current status.
GET /server/stats Optional query parameter: period=day|week|month. Aggregate statistics for the period.
GET /server/history The same period. Chart data in points.
POST /server/joins eventId: UUID; count: integer 1–1000; occurredAt: ISO 8601 with a timezone. recorded, duplicate, eventId.
POST /rewards/link playerId: game ID. This method specifically uses playerId. code and expiresAt.
POST /players/resolve players: 1–50 {kind,id} objects. A players array of the same length and order.
POST /votes/check One player object: {kind,id}. Active votes and pending events.
POST /rewards/claim player and a newly persisted UUID requestId. delivery and events.
POST /rewards/ack deliveryId: the received batch's UUID. acknowledged: true.

votes/check and rewards/claim also accept the older playerId field. Send either it or player, never both. Game-ID formatting rules still apply. New integrations should prefer explicit {kind,id} references.

Unknown body fields and query parameters are rejected. These methods do not support extra serverId, limit, arbitrary dates or filters. There is no bulk list of website accounts or all server votes: reward collection and personal checks take a player already known to your plugin.

Full request and response schemas: OpenAPI. You can also download this guide as Markdown.

Limits

Limit Value
All methods for one server combined 120 requests per minute.
All /v1 requests from one IP 300 per minute, shared by keys using that IP.
/server/joins reports An additional limit of 10 per minute per server.
New link code for one game ID Once per 60 seconds; a code lasts 10 minutes.
JSON body size 2 KiB, or 24 KiB for /players/resolve.
Players in /players/resolve 1–50 per request. One invalid reference rejects the whole request.
Events per delivery Up to 20; acknowledge within two minutes.
Event / delivery record lifetime Up to 30 days after the vote / two days after delivery creation.
A player's links Up to 100 servers, one game account per server.
Statistics and history cache 30 seconds. Personal vote responses are not cached.

On 429, use Retry-After rather than a fixed delay. For a large server network, stagger updates and cache statistics on your backend. Perform vote requests asynchronously: polling every player every second will quickly consume shared limits.

Response dates use UTC ISO 8601. Vote IDs, delivery IDs, requestId and eventId are different identifiers. Generate new request and join-event IDs with your platform's UUID generator rather than constructing them from a nickname, player number or current second.

Errors and connection checklist

Error response
json
{"code":"INVALID_API_KEY","message":"Неверный ключ API"}

Check the HTTP status and code in plugin code. The human-readable message may be revised. A failing proxy may return a non-JSON body; treat that as a temporary failure and preserve the original job for retry.

Status / code What to check
400 INVALID_BODY, UNEXPECTED_FIELD, UNEXPECTED_QUERY Send a JSON object containing only the method's fields. Remove extra query parameters.
401 INVALID_API_KEY The complete key, Bearer header, enabled API, verified owner email and current server ownership. Update every worker after replacing a key.
403 SERVER_SIDE_ONLY The request came from a browser with Origin. Move it to a plugin or backend.
413 BODY_TOO_LARGE Reduce the JSON body to the method's size limit.
422 INVALID_PLAYER_ID, AMBIGUOUS_PLAYER, INVALID_PLAYERS Check ID format, supported kind, array length and whether you supplied both player and playerId.
422 INVALID_CLAIM, INVALID_DELIVERY Check the request or delivery UUID, not the player's ID.
422 INVALID_PERIOD Only day, week and month are accepted.
422 INVALID_JOIN_BATCH, INVALID_JOIN_TIME Check the integer count, batch UUID, ISO timestamp, batch age and server clock.
429 LINK_COOLDOWN, RATE_LIMITED, JOINS_RATE_LIMITED Wait Retry-After seconds, then retry the relevant job.
503 REWARDS_NOT_CONFIGURED, API_BUSY, or another 5xx Retry later with the same IDs and body. Contact support if it continues.

If rewards are missing, check each step: GET /server works with your key → players/resolve finds the link → the vote was cast after linking → claim returns events → the queue persists them → ack succeeds → your game worker awards them. pendingRewards > 0 with an empty claim often means another two-minute delivery still holds the events.

When contacting Asomiru support, include the method, request time, server ID, HTTP status and code. Do not send your API key or password.