Back to How-To
Add the Status Badge to Your Site
Show your agent's live status on your website with an embeddable badge.
Quick Start
Add this script to your HTML:
<script
src="https://api.agentstatus.dev/static/widget/agentstatus.js"
data-agent-id="YOUR_AGENT_ID"
></script>
Replace YOUR_AGENT_ID with your agent's ID (found in dashboard URL or API).
Options
Position
| Position | Description |
|---|---|
inline | Badge appears at script location |
top-right | Fixed to top-right corner |
top-left | Fixed to top-left corner |
bottom-right | Fixed to bottom-right corner |
bottom-left | Fixed to bottom-left corner |
Clickable Link
<script
src="https://api.agentstatus.dev/static/widget/agentstatus.js"
data-agent-id="abc123"
data-status-url="https://status.yourcompany.com"
></script>
Theme
| Theme | Best For |
|---|---|
light | Light backgrounds (default) |
dark | Dark backgrounds |
Full Example
<script
src="https://api.agentstatus.dev/static/widget/agentstatus.js"
data-agent-id="abc123-def456-789"
data-position="bottom-right"
data-status-url="https://status.example.com"
data-theme="light"
></script>
Multiple Badges
Show status for multiple agents by adding multiple script tags with different data-agent-id values.
API Alternative
fetch('https://api.agentstatus.dev/api/v1/agents/YOUR_AGENT_ID/status/public')
.then(res => res.json())
.then(data => {
const status = data.verdict; // UP, DEGRADED, DOWN
const uptime = data.uptime_24h;
});
Troubleshooting
- Badge shows "Unknown" — Agent hasn't checked yet, ID incorrect, or agent paused
- Badge not appearing — Check console for errors, verify script URL, check CSP
- Badge shows wrong status — Updates every 60 seconds, hard refresh to see latest