
How I Built a Carbon Footprint Badge for Websites
How I Built a Carbon Footprint Badge for Websites Last year, I stumbled on a concerning statistic: the average website produces 0.81g of CO2 per page view . That's not trivial when you multiply it by billions of daily page loads. I decided to build something that would help developers visualize—and care about—their site's environmental impact. Enter: Carbon Badge . The Idea Website carbon footprint badges already exist, but I wanted something: Easy to embed on any website (single line of HTML) Automatically updated (no manual recalculation) Visually honest (green if you're good, red if you're not) Built on real data (not hand-wavy estimates) The Data Layer: Google PageSpeed Insights API Instead of inventing my own metrics, I decided to piggyback on Google's PageSpeed Insights API, which already measures page load performance and analyzes Core Web Vitals. Turns out Google publishes research linking page load time to energy consumption: faster pages = less CPU work = less CO2. const fetc
Continue reading on Dev.to Webdev
Opens in a new tab



