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'
}
});
Quick Links
| Resource | Description |
|---|---|
| API Introduction | Overview, authentication, and HTTP status codes |
| Create a Recipe | Score a recipe with environmental metrics |
| API Reference | Field values, units, and response structures |
Workflow Overview
- Create a Kitchen — Recipes belong to a kitchen (Create Kitchen)
- Create Recipes — Submit recipes with ingredients (Create Recipe)
- Get Results — Retrieve CO₂ values, ratings, and metrics (Get Recipe)
Next Steps
- App Quick Start — Use the Gastro web app instead
- Onboarding Guide — Full integration process
- Software Partners — Pre-built integrations