Estimating server emissions
Every server releases CO2 and other greenhouse gasses in their manufacture, use, and disposal. With the Server API, you can calculate the emissions of your servers.
When to use this API
Our model for estimating server emissions works best for servers that follow these criteria:
- More than 50% of the server's emissions are from its use.
- The server is in a data centre
- The server's utilisation rate is around 85%
This API isn't suited for laptops or PCs. To look up their emissions, use the Products API.
Matching servers to our database
We have a database of servers with their emissions. When possible, we match these servers. This dataset (like any other) is incomplete, so the API might match to wrong servers. We're working on collecting data on more servers which will improve the matching.
When the API can't find a matching server, we use our model to estimate emissions.
Our emissions model
When you provide the API with details about your server, include as much data as possible. Our research team uses all the parameters you provide to improve the emissions model, returning more accurate values.
The model we're using for estimating emissions data is currently based only on the RAM size of the server. There is a complicated relationship between RAM and emissions which takes into account infrastructure power draw, server utilisation rate, and energy intensity, among other factors.
Getting started
Step 1 - Identify your server
To make sure we're all talking about the same server, generate an ID for your server using Find a server. Specifying more parameters about the server will yield a more accurate response.
const serversUrl = 'https://api.ditchcarbon.com/v1.0/servers';
const options = {
method: 'GET',
headers: {accept: 'application/json', authorization: 'Bearer TOKEN'}
};
const serverParameters = new URLSearchParams({
model: "1253Ra Datacenter Server",
manufacturer_name: "ZT Systems"
})
fetch(serversUrl + "?" + serverParameters, options)
.then(res => res.json())
.then(json => console.log(json.id))
Step 2 - Find your server's emissions
Now that we know the ID of the server, we can estimate the server's emissions using Estimate emissions from a server.
const emissionsParameters = new URLSearchParams({
hours: 31 * 24
})
fetch(serversUrl + "/" + json.id + "emissions?" + emissionsParameters, options)
.then(res => res.json())
.then(json => console.log(json.kg_co2e))
Updated almost 2 years ago