Render a status page badge SVG
GET
/public/status-pages/{slug}/badge.svg
const url = 'https://api.perstat.io/public/status-pages/example/badge.svg';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.perstat.io/public/status-pages/example/badge.svgReturns an embeddable shields-style SVG badge showing the page’s overall status or, with metric=uptime, the aggregated uptime percentage. Responses are client-cacheable for five minutes and served with permissive cross-origin embedding headers. Protected pages require a valid viewer token or unlock cookie and otherwise answer 404 to hide their existence; the viewer token travels as a query parameter because image tags cannot send headers.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”slug
required
string
Query Parameters
Section titled “Query Parameters”metric
string
Status (Default) oder uptime
token
string
Viewer-Token für private Seiten
Responses
Section titled “Responses”Media typeimage/svg+xml