Skip to main content

Overview

The Analytics API provides comprehensive insights into event performance, sustainability metrics, carbon footprint tracking, and trend analysis. Use these endpoints to monitor environmental impact and optimize future events.

Authentication

All API requests require an API key to be included in the header:
Authorization: Bearer YOUR_API_KEY

Get Sustainability Metrics

GET /api/analytics/sustainability

Retrieve comprehensive sustainability metrics across all events or filtered by date range.

Query Parameters

startDate
string
Start date for metrics calculation (ISO 8601 format)
endDate
string
End date for metrics calculation (ISO 8601 format)
eventIds
string
Comma-separated list of event IDs to include in metrics
granularity
string
default:"total"
Data granularity (“total”, “daily”, “weekly”, “monthly”)

Response

carbonFootprint
object
Total carbon footprint metrics
wasteManagement
object
Waste reduction and recycling metrics
energyConsumption
object
Energy usage metrics
sustainablePractices
object
Adoption of sustainable practices
certifications
object
Sustainability certifications achieved
Historical trend data (if granularity is not “total”)
summary
object
Summary statistics

Example

curl -X GET "https://api.ecoevents.com/api/analytics/sustainability?startDate=2026-01-01T00:00:00Z&endDate=2026-12-31T23:59:59Z&granularity=monthly" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "carbonFootprint": {
    "totalEmissions": 45.8,
    "emissionsPerAttendee": 91.6,
    "breakdown": {
      "travel": 25000,
      "venue": 12000,
      "catering": 6000,
      "materials": 2500,
      "waste": 300
    },
    "offsetTotal": 40.2,
    "offsetPercentage": 87.8
  },
  "wasteManagement": {
    "totalWaste": 850,
    "recycled": 420,
    "composted": 280,
    "landfill": 150,
    "diversionRate": 82.4,
    "wastePerAttendee": 1.7
  },
  "energyConsumption": {
    "totalEnergy": 2400,
    "renewablePercentage": 75,
    "energyPerAttendee": 4.8,
    "breakdown": {
      "solar": 1200,
      "wind": 600,
      "grid": 600
    }
  },
  "sustainablePractices": {
    "localSourcing": 85,
    "digitalFirst": 92,
    "publicTransit": 45,
    "vegetarianOptions": 68,
    "reusableMaterials": 78
  },
  "certifications": {
    "iso20121": 3,
    "leedCertified": 5,
    "carbonNeutral": 4
  },
  "summary": {
    "totalEvents": 8,
    "totalAttendees": 2450,
    "dateRange": {
      "start": "2026-01-01T00:00:00Z",
      "end": "2026-12-31T23:59:59Z"
    }
  }
}

Get Event Analytics

GET /api/analytics/events/:id

Retrieve detailed analytics for a specific event.

Path Parameters

id
string
required
The unique identifier of the event

Response

eventId
string
Event identifier
eventName
string
Event name
attendance
object
Attendance metrics
demographics
object
Attendee demographics
sustainability
object
Event-specific sustainability metrics
engagement
object
Engagement metrics
financial
object
Financial metrics
feedback
object
Attendee feedback summary

Example

curl -X GET https://api.ecoevents.com/api/analytics/events/evt_1a2b3c4d5e6f \
  -H "Authorization: Bearer YOUR_API_KEY"

Get Trend Data

GET /api/analytics/trends

Retrieve trend analysis and comparative metrics across events.

Query Parameters

metric
string
required
Metric to analyze (“carbon_emissions”, “attendance”, “waste_reduction”, “energy_usage”, “offset_participation”)
startDate
string
required
Start date for trend analysis (ISO 8601 format)
endDate
string
required
End date for trend analysis (ISO 8601 format)
granularity
string
default:"monthly"
Time granularity (“daily”, “weekly”, “monthly”, “quarterly”)
category
string
Filter by event category
comparison
boolean
default:"false"
Include industry benchmark comparison

Response

metric
string
The metric being analyzed
dateRange
object
Date range of analysis
dataPoints
array
Time series data points
statistics
object
Statistical analysis
benchmark
object
Industry benchmark comparison (if requested)
insights
array
AI-generated insights and recommendations

Example

curl -X GET "https://api.ecoevents.com/api/analytics/trends?metric=carbon_emissions&startDate=2026-01-01T00:00:00Z&endDate=2026-12-31T23:59:59Z&granularity=monthly&comparison=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Example

{
  "metric": "carbon_emissions",
  "dateRange": {
    "start": "2026-01-01T00:00:00Z",
    "end": "2026-12-31T23:59:59Z"
  },
  "dataPoints": [
    {
      "date": "2026-01",
      "value": 5200,
      "eventCount": 2
    },
    {
      "date": "2026-02",
      "value": 4800,
      "eventCount": 1
    }
  ],
  "statistics": {
    "average": 5725,
    "median": 5600,
    "min": 3200,
    "max": 8500,
    "standardDeviation": 1250,
    "trend": "decreasing",
    "changePercentage": -12.5
  },
  "benchmark": {
    "industryAverage": 6500,
    "percentile": 72,
    "comparison": "above"
  },
  "insights": [
    "Carbon emissions decreased by 12.5% over the year",
    "Your events produce 11.9% less emissions than industry average",
    "Consider increasing renewable energy usage to reach top 10% percentile"
  ]
}

Error Responses

All endpoints may return the following error responses:
error
object
Error details

Common Error Codes

Status CodeError CodeDescription
400INVALID_REQUESTInvalid request parameters
400INVALID_DATE_RANGEInvalid or unsupported date range
400INSUFFICIENT_DATANot enough data for requested analysis
401UNAUTHORIZEDMissing or invalid API key
403FORBIDDENInsufficient permissions
404NOT_FOUNDEvent not found
429RATE_LIMIT_EXCEEDEDToo many requests
500INTERNAL_ERRORServer error

Build docs developers (and LLMs) love