Skip to main content

API Quick Start

The Eaternity API calculates environmental scores (CO₂, water footprint, Vita Score) for recipes and ingredients.

Get API Access

Contact info@eaternity.ch to request API credentials.

Authentication

The API uses HTTP Basic Authentication. Your API key is the username — no password required.

# The -u flag handles Base64 encoding automatically
curl -u YOUR_API_KEY: \
-H "Content-Type: application/json" \
https://co2.eaternity.ch/api/kitchens
// JavaScript/Node.js
const apiKey = 'YOUR_API_KEY';
const auth = btoa(apiKey + ':'); // Base64 encode "apikey:"

fetch('https://co2.eaternity.ch/api/kitchens', {
headers: {
'Authorization': 'Basic ' + auth,
'Content-Type': 'application/json'
}
});
ResourceDescription
API IntroductionOverview, authentication, and HTTP status codes
Create a RecipeScore a recipe with environmental metrics
API ReferenceField values, units, and response structures

Workflow Overview

  1. Create a Kitchen — Recipes belong to a kitchen (Create Kitchen)
  2. Create Recipes — Submit recipes with ingredients (Create Recipe)
  3. Get Results — Retrieve CO₂ values, ratings, and metrics (Get Recipe)

Next Steps