Carbon Badge
Embed a lightweight CO₂e badge — api mode (Insight) or estimate (local).
Open-source web component @cometweb/carbon-badge (MIT). api measures a URL via the public API; estimate uses the current page’s Performance API weight. Transfer estimate — not an ESG certificate.
mode=api — Insight public API measures the given URL (here: cometweb.io).
urlURL for API (defaults to current). In estimate it does not drive page weight.modeapi | estimate — default apithemedark | lightcache-ttllocalStorage cache minutes (default 720 = 12h). Within TTL: last successful result. After expiry: re-fetch API; on rate-limit/timeout → estimate fallback; on hard failure → error state (no invented grade).api-urlhttps://app.cometweb.io/api — public, no auth; 10 req/min/IP; max 20 unique URLs/h/IPgreen-hostestimate only — "true" lowers hosting factorThis estimates page transfer emissions — not an org-wide footprint or ESG certificate.
SWDM v4 model
CO₂e estimate via the Sustainable Web Design Model (Green Web Foundation). API responses also expose Insight formula_version.
~4.7 KB gzip
@cometweb/carbon-badge@1.0.6 — zero runtime dependencies.
api or estimate
api: GET /api/public/carbon-badge (no auth). estimate: local Performance API — no API calls.
theme dark / light
Two built-in web component themes — no custom CSS required.
MIT license
Open source: use commercially, self-host, modify — no fee for the widget.
Public API limits
Free, no auth. Limit: 10 req/min per IP; max 20 unique URLs/h per IP. Server cache ~12h. For high traffic use mode=estimate.
Links to Ecology
Click opens cometweb.io/insight/ecology (module page), not an ESG certificate or a full project report.