🚀 On a mission to reduce the carbon footprint of the Internet! 🌎

Website Carbon Badges

We've added website carbon badges so you can show off how good your website is for the planet.

Getting started

It's really simple and flexible to use:

1. Login to EcoPing and add a site to your reports page


2. Copy the Badge URL from your list of sites

By clicking on the copy icon () will save the badge URL to your clipboard.


3. Pop it in an image tag

<img src="https://ping-api.ecoping.earth/public/ecoping-earth-wm8m0e2v/badge" />

Stats

Getting stats about your website is easy too:

1. Use the /stats endpoint

We can take the Badge URL from above and instead of hitting /badge endpoint, we can swap it for /stats. This will return some lovely stats on carbon comparisons from your website:

From /badge:

https://ping-api.ecoping.earth/public/ecoping-earth-wm8m0e2v/badge

To /stats:

https://ping-api.ecoping.earth/public/ecoping-earth-wm8m0e2v/stats
{
"co2grams": 0.75,
"pageSize": 1381140,
"conversions": {
"cigarettes": {
"perMonth": 374115.11,
"perView": 3.5,
"perYear": 4489381.29,
},
"cupsOfTea": {
"perMonth": 7324.23,
"perView": 0.07,
"perYear": 87890.7
},
"farts": {
"perMonth": 233500,
"perView": 233.5,
"perYear": 2802000
},
"flightsFromLondonToLA": {
"perMonth": 0,
"perView": 0,
"perYear": 0.04
},
"grams": {
"perMonth": 4670,
"perView": 4.67,
"perYear": 56040
},
"kgs": {
"perMonth": 4.67,
"perView": 0.00467,
"perYear": 56.04
},
"loadsOfLaundry": {
"perMonth": 7.78,
"perView": 0.01,
"perYear": 93.4
},
"steaks": {
"perMonth": 1.26,
"perView": 0,
"perYear": 15.13
},
"trees": {
"perMonth": 0.21,
"perView": 0,
"perYear": 2.55
}
}
}
interface IStatsResponse {
/** Carbon emissions per page view in grams */
co2grams: number;
/** Website page size in bytes */
pageSize: number;
/** Carbon comparisons based off co2grams */
comparison: IConversions;
}
interface IConversions {
/** carbon footprint in kilograms */
kgs: IConversionsDurations;
/** carbon footprint in grams */
grams: IConversionsDurations;
/** Number of mature trees that would would need to absorb co2grams */
trees: IConversionsDurations;
/** Laundry washed at 30°C, dried on the line */
loadsOfLaundry: IConversionsDurations;
/** Cup of tea with Cow's milk */
cupsOfTea: IConversionsDurations;
/** Emissions produced by smoking a cigarette */
cigarettes: IConversionsDurations;
/** 1 person flying from London to Los Angeles in economy class */
flightsFromLondonToLA: IConversionsDurations;
/** To produce a 225g steak of beef */
steaks: IConversionsDurations;
/** Human fart emissions */
farts: IConversionsDurations;
}
interface IConversionsDurations {
/** Calculation per page view */
perView: number;
/** Calculation per page view / per month */
perMonth: number;
/** Calculation per page view / per year */
perYear: number;
}

Pro tip, get conversions based of monthly views:

Simply add a query parameter of monthlyViews to the end of the /stats endpoint and it will return you the calculations based of these views.

// By default monthlyViews is set to 1
/stats?monthlyViews=2300
Back to blog
🕯 We've gone for dark mode to reduce the display power drawn of your devices.

EcoPing - alpha

Please feel free to get in touch

@EcoPingHQ

Content

© EcoPing 2021