← Blog
Tutorial 5 min read

How to Use Uptime Badges in Your GitHub README

An uptime badge shows your monitor's live availability percentage as a small SVG image. It updates automatically — no rebuilds, no manual updates. Here's how to add one to your README, docs, or website.

Open source projects and public APIs often display status badges in their README — build passing, coverage percentage, latest version. An uptime badge adds one more signal: "this service is running." It's a trust indicator that requires no maintenance once set up.


Step 1: Find your badge URL

Each PingBase monitor has a unique badge URL. To find it:

  1. Log into app.pingba.se
  2. Open a monitor
  3. Click Badge in the monitor detail view
  4. Copy the badge URL or the ready-to-use Markdown snippet

The badge URL format is:

https://app.pingba.se/badge/YOUR_MONITOR_ID

This returns a live SVG image. Every time it's loaded, it reflects the current uptime percentage for that monitor over the last 30 days.


Step 2: Add to your GitHub README

In Markdown, embed an image with a link:

# README.md

[![Uptime](https://app.pingba.se/badge/YOUR_MONITOR_ID)](https://pingba.se/status/YOUR_STATUS_PAGE_SLUG)

This renders as a clickable badge — clicking it takes users to your public status page where they can see uptime history and any active incidents.

The badge displays as:

Uptime 99.9% (example — your badge will show real data)

Badge styles

PingBase badges adapt their color automatically based on your current uptime:

Uptime range Badge color Label example
99.9% – 100%greenuptime | 99.9%
99% – 99.9%yellowuptime | 99.3%
95% – 99%orangeuptime | 97.1%
Below 95%reduptime | 91.2%
Monitor is currently downdark redstatus | down

Embedding in HTML (websites, docs)

For HTML pages — your docs site, landing page, or product website — use an <img> tag wrapped in a link:

# HTML embed

<a href="https://pingba.se/status/YOUR_SLUG">
  <img src="https://app.pingba.se/badge/YOUR_MONITOR_ID"
       alt="Uptime status"
       height="20" />
</a>

For Next.js or React, use the <img> directly or Next's Image component with unoptimized to preserve the live SVG:

import Image from 'next/image';

<a href="https://pingba.se/status/YOUR_SLUG">
  <Image
    src="https://app.pingba.se/badge/YOUR_MONITOR_ID"
    alt="Uptime"
    width={100}
    height={20}
    unoptimized
  />
</a>

Multiple monitors, one README section

If you have multiple components to display — API, dashboard, webhooks — you can show several badges in a row:

# README.md — multiple badges

## Status

[![API](https://app.pingba.se/badge/MONITOR_ID_API)](https://pingba.se/status/your-slug)
[![Dashboard](https://app.pingba.se/badge/MONITOR_ID_DASH)](https://pingba.se/status/your-slug)
[![Webhooks](https://app.pingba.se/badge/MONITOR_ID_WH)](https://pingba.se/status/your-slug)

This renders as a row of badges, each labeled with the monitor name, each linking to your status page. Users can see at a glance which components are healthy.


Caching behaviour

Badge SVGs from PingBase are served with short cache headers — they refresh within a few minutes of a status change. GitHub's CDN caches badge images for a few minutes on their end as well, which is normal behaviour for all badge providers (including Shields.io).

This means: if your service goes down, the badge will reflect that within a few minutes. It's not real-time to the second, but it's accurate enough for the purpose — giving README readers a current sense of your service's health.


Good places to put uptime badges

The badge works best when it's linked to your full status page. That way, curious users who click it see the full uptime history and any active incidents — not just a number.

Add an uptime badge to your README

Set up a free monitor on PingBase and get your badge URL in under 5 minutes.

Get started free →

Related