Badges

Embed a site's uptime or current status as an SVG image: both endpoints, their parameters, colors and embed snippets.

Last reviewed

On this page

A badge is a small SVG image that shows a site's uptime or current status. Put it in a README, a documentation page or your own website. The image is generated each time it's requested, so it follows the site.

Get the embed code

Open a site and find the Badge & Embed card on its detail page. It previews each badge and gives a Markdown snippet, an HTML snippet and a direct URL to copy. The uptime badge has 7d, 30d and 90d buttons that set its time window. The id in the address is the site's id, and it's the only thing that selects the site.

Uptime badge

GEThttps://octoping.com/api/badges/{webpage_id}.svg

Uptime Badge

  • webpage_id (path, string, required)
  • label (query, string, optional, default uptime)
  • days (query, integer, optional, default 30)
ParameterDefaultBehavior
labeluptimeThe text on the left of the badge.
days30The number of days to measure. Values below 1 are raised to 1 and values above 90 are lowered to 90.

The value is the site's uptime percentage over the window, rounded to two decimals. It's the same calculation as the uptime figure in the app, so maintenance time is left out and checks from every vantage point count. The uptime and outages page explains it. When the window holds no counted checks, the badge reads N/A.

The color of the value follows the percentage.

UptimeColor
99.9% or moreGreen
99% to under 99.9%Light green
95% to under 99%Orange
Under 95%Red
N/AGray

Status badge

GEThttps://octoping.com/api/badges/{webpage_id}/status.svg

Status Badge

  • webpage_id (path, string, required)
  • label (query, string, optional, default status)
ParameterDefaultBehavior
labelstatusThe text on the left of the badge.

The value is the site's current status in the public vocabulary, the same one a status page uses. The statuses are on the statuses page.

ValuePublic statusShown for
upOperationalOnline and Partial
degradedDegradedDegraded
downDownOffline
maintenanceUnder maintenanceMaintenance
unknownUnknownPending, and any site whose workspace has monitoring paused

Up is green, degraded is orange, down is red, maintenance is blue and unknown is gray.

Unknown sites

A site id that doesn't exist, or a site that's switched off, returns HTTP 404 with a gray badge that reads not found. The image still renders, so a stale embed shows a clear message instead of a broken picture.

Response headers

A badge that renders with HTTP 200 carries these headers.

  • Content type: image/svg+xml
  • Cache control: no-cache, max-age=300
  • CORS: Access-Control-Allow-Origin: *, so any page can load the image.

Embedding

Markdown:

markdown
![Uptime](https://octoping.com/api/badges/YOUR_SITE_ID.svg)
![Status](https://octoping.com/api/badges/YOUR_SITE_ID/status.svg)

HTML:

html
<img src="https://octoping.com/api/badges/YOUR_SITE_ID.svg" alt="Uptime" />
<img src="https://octoping.com/api/badges/YOUR_SITE_ID/status.svg" alt="Status" />

A longer window and a custom label:

text
https://octoping.com/api/badges/YOUR_SITE_ID.svg?days=90&label=90-day%20uptime