🏆 Hack for Humanity 2026

EcoIntellect API

The plug-and-play Sustainability Intelligence Layer for food delivery, ride booking, and e-commerce platforms. Integrate at checkout — give users real-time carbon data and eco-friendly alternatives.

Base URL (Local Demo): http://localhost:8000
Interactive Swagger docs: http://localhost:8000/docs

Quick Start

Send a POST request to analyze any food delivery order. No auth required in demo mode.

cURL Example
# Analyze a car-delivered, plastic-packaged order over 5 km
curl -X POST http://localhost:8000/api/v1/analyze-order \
  -H "Content-Type: application/json" \
  -d '{
    "distance_km": 5,
    "transport_mode": "car",
    "packaging_type": "plastic",
    "estimated_time_minutes": 30,
    "order_value": 350,
    "frequency_per_week": 3
  }'

Sponsor Integrations

EcoIntellect integrates two hackathon sponsor tools at the core of its calculation pipeline.

Sponsor Role Hackathon Status Production Path
GreenPT API Emission factors per transport mode & packaging ✅ Active (EPA baseline) Replace fallback with live API call in greenpt_integration.py
Wolfram|One Yearly projections, tree equivalents, 1M-user scenarios ✅ Active (live queries) Add richer NLP queries as needed
Verify integration status: GET http://localhost:8000/ returns "sponsor_integrations": {"greenpt": true, "wolfram": true}

Endpoints

POST /api/v1/analyze-order
Calculate the environmental footprint of a food delivery order. Returns emissions powered by GreenPT, alternatives, and a Wolfram|One yearly projection with 1k→1M user scale scenarios.
Request Body
{
  "distance_km": 5.0,          // Required. Delivery distance
  "transport_mode": "car",     // car | motorcycle | electric_vehicle | bike | walk
  "packaging_type": "plastic",  // plastic | paper | biodegradable | reusable
  "estimated_time_minutes": 30, // Estimated delivery time
  "order_value": 350,           // Order value in ₹ (for yearly cost projection)
  "frequency_per_week": 3       // How often user orders (1–21)
}
Response 200
{
  "carbon_emission_grams": 650.0,
  "eco_score": 20,              // 0–100 (higher = greener)
  "rating": "Poor",            // Excellent | Good | Moderate | Poor
  "better_alternatives": [
    {
      "transport_mode": "Bike",
      "packaging_type": "Reusable",
      "carbon_emission_grams": 5.0,
      "carbon_saved_grams": 645.0,
      "time_difference_minutes": 8,
      "eco_score": 95
    }
  ],
  "yearly_projection": {          // Powered by Wolfram|One
    "total_orders_per_year": 156,
    "total_carbon_kg": 101.4,
    "trees_needed_to_offset": 5,
    "equivalent_car_km": 845.0,
    "money_spent": 54600.0,
    "scale_scenarios": [          // Wolfram impact simulation
      { "users": 1000,    "total_co2_saved_tonnes": 101.4,    "label": "1,000 users"    },
      { "users": 10000,   "total_co2_saved_tonnes": 1014.0,   "label": "10,000 users"   },
      { "users": 100000,  "total_co2_saved_tonnes": 10140.0,  "label": "100,000 users"  },
      { "users": 1000000, "total_co2_saved_tonnes": 101400.0, "label": "1,000,000 users" }
    ]
  },
  "environmental_context": "That's equivalent to driving 811 km by car."
}
GET /api/v1/compare-alternatives
Returns all 16 transport × packaging combinations ranked by Eco Score (best first).
Query Params
Param Type Default Description
distance_km float Required. Delivery distance
transport_mode string car Current transport choice
packaging_type string plastic Current packaging choice
Example Response
{
  "distance_km": 5.0,
  "total_options": 16,
  "options": [
    { "transport_mode": "bike", "packaging_type": "reusable", "eco_score": 95, "rating": "Excellent" },
    { "transport_mode": "bike", "packaging_type": "biodegradable", "eco_score": 95 },
    // ... 14 more options
  ]
}
GET /api/v1/user-impact/{user_id}
Gamified sustainability profile — Eco Score, carbon saved, achievements, rank percentile, and Wolfram-powered annual projection.
Response 200
{
  "total_orders": 87,
  "eco_score": 84,
  "total_carbon_saved_kg": 12.3,
  "rank_percentile": 85,
  "achievements": ["🌟 Eco Champion", "🌱 Sustainability Advocate"],
  "yearly_projection": { /* same shape as analyze-order */ }
}

Zomato / Swiggy Integration Example

Three steps to integrate EcoIntellect at checkout in any food delivery app.

Step 1 — Call API before showing "Place Order"

// JavaScript — Food delivery checkout flow
const ecoAnalysis = await fetch('https://api.ecointellect.io/v1/analyze-order', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    distance_km: calculateDistance(restaurant, userAddress),
    transport_mode: selectedDeliveryType,   // "car" | "bike" | "electric_vehicle"
    packaging_type: restaurantPackaging,    // "plastic" | "biodegradable"
    order_value: cartTotal,
    frequency_per_week: getUserFrequency(userId)
  })
}).then(r => r.json());

Step 2 — Intercept with eco suggestion if score < 60

if (ecoAnalysis.eco_score < 60 && ecoAnalysis.better_alternatives.length > 0) {
  const best = ecoAnalysis.better_alternatives[0];
  showEcoInterceptModal({
    title: "EcoIntellect Suggestion! 🌱",
    saving: `Save ${best.carbon_saved_grams}g CO₂`,
    option: `${best.transport_mode} + ${best.packaging_type}`,
    discount: 10  // ₹10 eco-discount incentive
  });
}

Step 3 — Show cumulative impact in user profile

const impact = await fetch(`/api/v1/user-impact/${userId}`).then(r => r.json());
renderEcoBadge({
  score:       impact.eco_score,          // 0–100
  carbonSaved: impact.total_carbon_saved_kg,
  rank:        impact.rank_percentile,    // "Top 15% of users"
  badges:      impact.achievements
});
💡 Key Insight: Users are 3× more likely to choose eco options when presented at decision-time, not post-purchase. EcoIntellect intercepts at the perfect moment.

Production Integration Guide

How the hackathon demo maps to a production SaaS deployment.

Component Hackathon Demo Production Path
Emission factors EPA baseline in GreenPTClient Uncomment live GreenPT API call
Yearly projections Wolfram API (active) + math fallback Full Wolfram|One NLP queries
User data Statistically representative mock PostgreSQL / Supabase
Authentication Open (demo) JWT or API key middleware
Hosting Local (localhost:8000) Railway / Render + Vercel

Upgrading GreenPT to Production

# backend/app/services/greenpt_integration.py

def get_emission_factor(self, category, item):
    if self.api_key:
        # ✅ Uncomment for production
        # response = requests.post(
        #     f"{self.base_url}/emissions/factor",
        #     headers={"Authorization": f"Bearer {self.api_key}"},
        #     json={"category": category, "item": item}
        # )
        # return response.json()["co2_grams"]
        pass

    # Demo: EPA-sourced baseline
    return self.demo_transport_factors.get(item, 100)

Wolfram|One Scale Scenarios

Every API response includes a live Wolfram|One computation showing CO₂ impact as user adoption scales.

101 t
CO₂ saved/year · 1,000 users
1,014 t
CO₂ saved/year · 10,000 users
10,140 t
CO₂ saved/year · 100,000 users
101,400 t
CO₂ saved/year · 1,000,000 users 🌳
Equivalent to planting 4.6 million trees if 1M food delivery users switched to eco-friendly options — computed live by Wolfram|One.

Status Codes

Code Meaning
200 Success — full response returned
400 Bad Request — invalid or missing parameters
422 Unprocessable Entity — Pydantic validation failed
500 Internal Server Error — check server logs
Interactive Docs: Full try-it-now Swagger UI is available at http://localhost:8000/docs — all endpoints are explorable without any client setup.