API documentation

Version 1. All responses are JSON. Times in UTC (ISO 8601). Base address: https://toplisten.online/api/v1

Error messages from the API are in German by default. Send the header Accept-Language: en to get them in English.

Basics

Successful responses have the form {"data": …}, lists also include "meta" with page and total. Errors look like this:

{"error": {"status": 422, "message": "Parameter q fehlt."}}

Status codes: 200 OK, 202 accepted, 401 key missing or invalid, 403 no permission, 404 not found, 409 conflict, 422 invalid input, 429 too many requests (with Retry-After).

Public endpoints

Usable without signing in, for example for widgets. Responses may be cached for 60 seconds.

GET /projects

Published bots or servers, 20 entries per page. Parameters:

  • type: bot (default) or server
  • q (search), category (category slug), page
  • Bots only: price (free, freemium, paid), sort (relevance, votes, rating, new)
  • Servers only: language (de, en, fr, es, multi), sort (relevance, members, votes, rating, new)

Servers include member_count and presence_count (members and currently online, according to Discord) with counts_checked_at. We check the numbers about every 12 hours. invite_valid is false if the invite has failed several times in a row.

curl "https://toplisten.online/api/v1/projects?type=server&category=games&sort=members"

GET /search?q=music

Like /projects, but q is required. type applies here too.

GET /projects/{id}

A bot with description, categories, commands, links and permissions (permissions requested by the invite link with risk: critical, high, medium, low and an optional explanation by the developers in note) or a server with description, categories, server ID (guild_id) and join link. Which kind it is, is stated in type. Plus freshness: freshness score score (0 to 100), level (good, ok, bad) and for each item (review, app, website, commands, count or, for servers, invite) status (fresh, aging, stale, failed, pending, none) and checked_at.

GET /projects/{id}/reviews

Published reviews, most helpful first, 20 per page.

GET /categories

All active categories.

Badges and project cards

SVG images to embed on websites, in README files and forums. No key, no cookies, no scripts. They are cached for up to 10 minutes. Ready-to-copy codes are in the dashboard under “Embed”. For unpublished projects, “not available” appears. The texts are in German by default; add ?lang=en for English (for cards: ?theme=light&lang=en).

GET /badge/{id}/{metric}.svg

Small badge. Metrics for bots: votes, rating, servers, status (Bot Health Monitor), rank (place in the monthly ranking, first of the completed previous month, otherwise of the current month). For servers: votes, rating, members, online, rank. Example in English: https://toplisten.online/badge/123/votes.svg?lang=en.

GET /card/{id}.svg

Project card (360 × 112) with image, name, short description and metrics. With ?theme=light in a light version.

<a href="https://toplisten.online/en/bot/beispiel-123"><img src="https://toplisten.online/badge/123/votes.svg" alt="Votes on Toplisten"></a>

With API key

You create keys in the dashboard under API. Each key belongs to exactly one project and only has the chosen permissions. Send it in the header:

Authorization: Bearer tl_xxxxxxxx_…

Keep the key secret: only in the bot on the server, never in the browser or in a public repository. If it gets into the wrong hands, revoke it immediately.

POST /projects/{id}/stats · permission stats

Reports the server count. It appears with the source “Developer API” and the time; the last value of a day goes into the server count history on the bot page. At most 12 reports per hour; every 30 minutes is enough. Ready-made examples for discord.js, discord.py and PHP are shown by the setup assistant in the dashboard.

curl -X POST https://toplisten.online/api/v1/projects/123/stats \
  -H "Authorization: Bearer $TOPLISTEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"server_count": 1520}'

GET /votes/check?user_id={Discord ID} · permission votes

Has this person voted for your project in the last hours (current cooldown)?

{"data": {"voted": true, "pending_review": false, "voted_at": "2026-11-10T08:15:00Z", "next_vote_at": "2026-11-10T20:15:00Z"}}

pending_review means: the vote is still being checked and does not count yet. Do not give a reward for it yet.

POST /commands/sync · permission commands

Replaces your project’s command list (at most 100). Names in lower case, up to three words for subcommands.

{"commands": [{"name": "play", "description": "Plays a song"}, {"name": "queue list", "description": "Shows the queue"}]}

GET /analytics?days=30 · permission analytics

Daily values: views, clicks on “Add bot”, votes and search hits (at most 90 days).

POST /projects/{id}/heartbeat · permission health

Sign of life for the Health Monitor (switch on in the dashboard under “Status”). Send every 1 to 5 minutes, at most twice per minute. Without a report for 10 minutes the bot counts as offline. Optional body:

{"status": "ok"}      // or "degraded" for “Limited”

The single lookup GET /projects/{id} then contains health with status (online, degraded, offline, maintenance, unknown), last_heartbeat_at and the availability in percent. Publicly, the status page /bot/{slug}-{id}/status shows the availability of the last 30 days and all outages.

POST /webhooks/test · permission webhooks

Sends a test event to your webhook (response 202).

Webhooks for votes and reviews

Set up an HTTPS address in the dashboard under Votes and webhooks. For every counted vote we send a POST. We only send suspicious votes after our team has checked them.

{
  "event_id": "1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed",
  "event_type": "vote.created",
  "occurred_at": "2026-11-10T08:15:02Z",
  "project_id": 123,
  "data": {"vote_id": 456, "user": {"discord_id": "123456789012345678"}, "voted_at": "2026-11-10T08:15:00Z", "is_test": false}
}

Headers: X-Toplisten-Event, X-Toplisten-Event-Id, X-Toplisten-Timestamp (Unix seconds) and X-Toplisten-Signature: v1=…. The signature is HMAC-SHA256 with your webhook secret over timestamp + "." + body (body exactly as it arrives). Test events have "event_type": "vote.test" and "is_test": true.

Reviews (optional): If you switch on “Also send reviews” in the dashboard, the same address additionally receives review.created and review.updated as soon as a review is published or changed (held-back ones only after the check). The test is called review.test. Only what is publicly visible is included:

"data": {"review_id": 789, "rating": 5, "body": "Works great", "user": {"discord_id": "123456789012345678", "username": "Name"}, "created_at": "2026-11-10T08:15:00Z", "edited_at": null, "url": "https://toplisten.online/en/bot/beispiel-123#review-789", "is_test": false}

How to verify correctly: compare the signature in constant time, discard messages older than 5 minutes, process each event_id only once (it can arrive several times on retries) and respond with 2xx within 5 seconds. We do not follow redirects.

Node.js:

const crypto = require('crypto');
function isValid(rawBody, headers, secret) {
  const ts = headers['x-toplisten-timestamp'];
  if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const expected = 'v1=' + crypto.createHmac('sha256', secret).update(ts + '.' + rawBody).digest('hex');
  const given = String(headers['x-toplisten-signature'] || '');
  return given.length === expected.length && crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
}

Python:

import hmac, hashlib, time
def is_valid(raw_body: bytes, headers, secret: str) -> bool:
    ts = headers.get('X-Toplisten-Timestamp', '')
    if not ts.isdigit() or abs(time.time() - int(ts)) > 300:
        return False
    expected = 'v1=' + hmac.new(secret.encode(), ts.encode() + b'.' + raw_body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, headers.get('X-Toplisten-Signature', ''))

If a delivery fails (no 2xx, timeout), we retry after 1 min, 5 min, 30 min, 2 hr, 12 hr. After that we give up. You see the log in the dashboard.

Toplisten app interface

The Android app reads its content through its own public interface at https://toplisten.online/api/app/v1. It is built for the app; for your own integrations, version 1 above remains the stable choice. GET only, no key. Labels, category names and links to the website come in the language from Accept-Language (de or en). Every response has an ETag; with If-None-Match, unchanged content returns 304 without a body.

  • /meta (links, filters with labels, rules), /home (start page), /numbers (platform in numbers)
  • /bots and /servers with the same filters as the website (q, category, tag, sort, for bots price, language, noadmin, verified, rating, for servers language, size, rating, open, invite, verified) plus page and per_page (at most 50); meta.has_more tells whether more pages follow
  • /search?q= (bots and servers at once), /bots/{id}, /servers/{id}, /projects/{id}/reviews (with star distribution, sort=new for the newest)
  • /categories, /categories/{slug}, /ranking?type=bot|server&month=YYYY-MM, /trending, /collections, /collections/{id}
  • /status (all bots in the status monitor) and /bots/{id}/status (24 hours, 30 days, outages); both cacheable for 15 seconds
  • Sign-in: the app opens /app/login with PKCE (challenge, state) in the browser and exchanges the one-time code at POST /auth/token for a device key tla_…. With Authorization: Bearer tla_… there is /me and, under /me/…, voting, following (including outage alerts and categories), reviews, saving to collections and notifications, with the same rules as on the website; under /me/owner/… also the operator area for your own projects (figures for the last 30 days, status monitor, replies to reviews, changelog, API keys). These responses are private (Cache-Control: no-store). Signed-in devices are listed under “Account security”, where they can be signed out.

Limits

  • All endpoints together: 120 requests per minute per IP address.
  • Reporting server count: 12 per hour per key. Syncing commands: 10 per hour. Test webhook: 10 per hour.
  • At most 5 active keys and one webhook per project.

The API is new. Changes that break existing integrations only come with a new version (/api/v2).