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
Start date for metrics calculation (ISO 8601 format)
End date for metrics calculation (ISO 8601 format)
Comma-separated list of event IDs to include in metrics
Data granularity (“total”, “daily”, “weekly”, “monthly”)
Response
Total carbon footprint metrics Total CO2 emissions in metric tons
Average emissions per attendee in kg CO2
Emissions breakdown by category Emissions from attendee travel (kg CO2)
Emissions from venue energy use (kg CO2)
Emissions from food and beverages (kg CO2)
Emissions from event materials (kg CO2)
Emissions from waste disposal (kg CO2)
Total carbon offset contributions in metric tons
Percentage of emissions offset
Waste reduction and recycling metrics Total waste generated in kg
Amount sent to landfill in kg
Waste diversion rate as percentage
Average waste per attendee in kg
Energy usage metrics Total energy consumed in kWh
Percentage from renewable sources
Average energy per attendee in kWh
Energy breakdown by source
Adoption of sustainable practices Percentage of events using local sourcing
Percentage of events using digital materials
Percentage of attendees using public transit
Percentage of meals that are vegetarian/vegan
Percentage using reusable materials
Sustainability certifications achieved Number of ISO 20121 certified events
Number of events in LEED certified venues
Number of carbon neutral events
Historical trend data (if granularity is not “total”)
Summary statistics Total number of events analyzed
Total number of attendees
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
The unique identifier of the event
Response
Attendance metrics Number of attendees checked in
Attendance rate as percentage
Percentage of capacity used
Attendee demographics Top companies represented
Event-specific sustainability metrics Total emissions in kg CO2
carbonOffsetParticipation
Percentage participating in offset program
Recycling rate as percentage
Overall sustainability score (0-100)
Engagement metrics Average time spent at event in minutes
Session attendance breakdown
Number of networking connections made
Financial metrics Average revenue per attendee
Sales breakdown by ticket type
Attendee feedback summary Average event rating (1-5)
Survey response rate as percentage
Most common feedback themes
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 to analyze (“carbon_emissions”, “attendance”, “waste_reduction”, “energy_usage”, “offset_participation”)
Start date for trend analysis (ISO 8601 format)
End date for trend analysis (ISO 8601 format)
Time granularity (“daily”, “weekly”, “monthly”, “quarterly”)
Include industry benchmark comparison
Response
The metric being analyzed
Time series data points Number of events in period
Statistical analysis Average value across period
Trend direction (“increasing”, “decreasing”, “stable”)
Percentage change over period
Industry benchmark comparison (if requested) Industry average for metric
Your percentile ranking (0-100)
Performance vs industry (“above”, “average”, “below”)
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 details Error code (e.g., “INVALID_REQUEST”, “INSUFFICIENT_DATA”, “UNAUTHORIZED”)
Human-readable error message
Additional error context (optional)
Common Error Codes
Status Code Error Code Description 400 INVALID_REQUEST Invalid request parameters 400 INVALID_DATE_RANGE Invalid or unsupported date range 400 INSUFFICIENT_DATA Not enough data for requested analysis 401 UNAUTHORIZED Missing or invalid API key 403 FORBIDDEN Insufficient permissions 404 NOT_FOUND Event not found 429 RATE_LIMIT_EXCEEDED Too many requests 500 INTERNAL_ERROR Server error