Carbon Interface API

Environment / API Key Intermediate HTTPS CORS
Varies by plan (check documentation)

Overview

Carbon Interface API calculates estimated CO2 emissions for common activities such as electricity usage, flights, vehicle travel, and shipping. Authentication is done via an API key passed as a Bearer token in the Authorization header. It is an excellent API for building sustainability dashboards, carbon footprint calculators, or eco-friendly apps.

💡

Beginner Tip

Sign up for a free account at carboninterface.com to get your API key. Always send your requests as POST with a JSON body specifying the activity type and its parameters — this API does not use query strings for emission calculations.

Available Data

vehicle make and model
year and specifications
fuel economy
VIN decode data
prediction result with confidence score
input name or text

Example Response

JSON Response
{
  "make": "Toyota",
  "model": "Camry",
  "year": 2025,
  "engine": "2.5L 4-cylinder",
  "fuel_economy": {
    "city_mpg": 28,
    "highway_mpg": 39
  },
  "msrp": 28400
}

Field Reference

data.id Unique identifier for the emission estimate record.
data.type The type of estimate resource returned.
data.attributes.carbon_g Estimated CO2 emissions in grams.
data.attributes.carbon_kg Estimated CO2 emissions in kilograms.
data.attributes.carbon_mt Estimated CO2 emissions in metric tons.
data.attributes.estimated_at ISO 8601 timestamp of when the estimate was calculated.

Implementation Example

const url = "https://docs.carboninterface.com/";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

401 Unauthorized API key is missing or incorrectly formatted in the Authorization header.
Use the format Authorization: Bearer YOUR_API_KEY — note the word Bearer followed by a space before your key.
422 Unprocessable Entity Required fields are missing or have invalid values in the request body.
Check the Carbon Interface docs for required fields per activity type (e.g., electricity requires electricity_unit, electricity_value, and country).
429 Too Many Requests You have exceeded the rate limit for your plan.
Add delays between requests or upgrade your plan. Free tier has limited monthly API calls.

Matrix Score Breakdown

🌐 Reachability 30/30
⚡ Speed 15/20
🔒 Security 15/15
🛠 Developer XP 17/20
✓ Reliability 10/15

Partially tested on Apr 5, 2026

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS YES
Category Environment
Difficulty Intermediate
Verified: 2026-04-04

Similar APIs

View All →