Lantern Servers

How to Embed a Live Status Badge on Your Website

Walkthrough of the SVG status badge endpoint, with copy-paste embed code and customization tips.

What Is the Status Badge?

The status badge is a live SVG image that shows your server’s current online status and player count. It looks like this:

Status badge example

The badge is 200x60 pixels with a dark background, a green or red status dot, your server name, the word “Online” or “Offline”, and the current player count (e.g. 42 / 100 players).

It’s served from the endpoint: https://lanternservers.net/api/badge/your-server-slug.svg

The badge updates automatically every 60 seconds when the image is loaded. There’s no JavaScript or refresh logic needed - each time the page is viewed, the SVG reflects the latest ping data.

Generating Embed Code

The easiest way to get the embed code is to use the widget generator:

  1. Sign in to your account.
  2. Go to Widgets & Badges in the owners section.
  3. Select your server from the dropdown.
  4. Preview the badge and copy one of the three available snippets.

Option 1: Status Badge (Image Only)

A standalone image that displays your server’s live status:

<img
    src="https://lanternservers.net/api/badge/your-server-slug.svg"
    alt="Your Server Name status"
/>

Use this when you just want to show status without a clickable link.

Option 2: Vote Button (Linked Badge)

The same badge image, but wrapped in a link to your server’s detail page so visitors can click through and vote:

<a href="https://lanternservers.net/servers/your-server-slug" target="_blank" rel="noopener">
    <img
        src="https://lanternservers.net/api/badge/your-server-slug.svg"
        alt="Your Server Name status"
        style="border:none;"
    />
</a>

This is the most useful option - it shows live status and drives traffic to your listing at the same time.

A simple text hyperlink to your server’s detail page:

<a href="https://lanternservers.net/servers/your-server-slug"
    >Your Server Name on lanternservers.net</a
>

Use this in places where images aren’t supported, like email signatures or plain-text forums.

Finding Your Server Slug

Your server’s slug is the URL-friendly version of its name, visible in the address bar when viewing your server’s detail page. For example, if your server page is at /servers/epic-craft, your slug is epic-craft and your badge URL is /api/badge/epic-craft.svg.

You can also find it in your dashboard.

How the Badge Works Behind the Scenes

  • The endpoint reads the most recent ping data for your server across all regions.
  • If any region reports the server as online, the badge shows “Online” with the highest player count across regions.
  • If no region reports the server as online, the badge shows “Offline”.
  • The response is cached for 60 seconds, meaning the metrics won’t be instantly up-to-date.
  • The image is rendered as an SVG, it works in any context that accepts images - HTML <img> tags, Markdown, forum BBCode, and more.

Tips

  • Use the linked badge on your website homepage so visitors can see your server is active and click through to vote.
  • Add the badge to your Discord server in a widget or pinned message.
  • Include it in forum signatures on Minecraft communities and gaming forums.
  • The badge works even when your server is unlisted from search engines - as long as the server exists in the server list, the badge will render.

Troubleshooting

The badge shows “Server offline”

This means our pingers couldn’t reach your server in the most recent check. Verify your server is running and reachable from the internet using our status checker. If it’s a temporary outage, the badge will update automatically once pings succeed again.

The badge URL returns 404

Make sure you’re using the correct slug. Check your server’s detail page URL - the slug is the last segment. If you recently renamed your server, the slug may have changed.

The badge doesn’t update

The badge is cached for 60 seconds. Wait a minute and refresh the page. If you’re using a CDN or caching plugin on your own site, make sure it doesn’t cache the SVG for longer than 60 seconds.