API Documentation
Welcome to the Env API. Our RESTful API provides programmatic access to environmental data, carbon tracking, compliance reporting, and sustainability analytics. Build integrations, automate ESG workflows, and power your green technology stack.
https://api.env.com/v1. All requests must use HTTPS.
Authentication
Env uses Bearer token authentication. Include your API key in the Authorization header of every request.
curl -X GET https://api.env.com/v1/organizations/my-org\n -H "Authorization: Bearer sk_live_51HG3k9..."\n -H "Content-Type: application/json"
const response = await fetch('https://api.env.com/v1/organizations/my-org', {
method: 'GET',
headers: {
'Authorization': 'Bearer sk_live_51HG3k9...',
'Content-Type': 'application/json'
}
});
const data = await response.json();
import requests
headers = {
"Authorization": "Bearer sk_live_51HG3k9...",
"Content-Type": "application/json"
}
response = requests.get(
"https://api.env.com/v1/organizations/my-org",
headers=headers
)
data = response.json()
Carbon Footprint
Retrieve, calculate, and track carbon emissions across your organization's operations and supply chain.
Fetch the comprehensive carbon footprint report for a specific organization, broken down by Scope 1, 2, and 3 emissions.
Parameters
| Name | Type | Description |
|---|---|---|
| org_id | string | Your unique organization identifier |
| start_date | date | Start of reporting period (YYYY-MM-DD) |
| end_date | date | End of reporting period |
| scope | string | Filter by scope: 1, 2, 3, or all |
Example Request
curl -X GET "https://api.env.com/v1/carbon-footprint/org_123?start_date=2024-01-01&end_date=2024-12-31&scope=all" \
-H "Authorization: Bearer YOUR_API_KEY"
response = requests.get(
"https://api.env.com/v1/carbon-footprint/org_123",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={
"start_date": "2024-01-01",
"end_date": "2024-12-31",
"scope": "all"
}
)
Example Response
{
"org_id": "org_123",
"period": {
"start": "2024-01-01",
"end": "2024-12-31"
},
"total_co2e_tons": 14520.8,
"breakdown": {
"scope_1": {
"tons": 3200.5,
"percentage": 22.04,
"sources": ["natural_gas", "fleet_vehicles"]
},
"scope_2": {
"tons": 4100.2,
"percentage": 28.24,
"sources": ["grid_electricity"]
},
"scope_3": {
"tons": 7220.1,
"percentage": 49.72,
"sources": ["business_travel", "supply_chain", "waste"]
}
},
"status": "verified",
"methodology": "GHG_Protocol_2023"
}
Rate Limits
To ensure platform stability, API requests are rate-limited based on your subscription tier.
| Header | Description |
|---|---|
| X-RateLimit-Limit | Max requests per window |
| X-RateLimit-Remaining | Remaining requests in current window |
| X-RateLimit-Reset | Unix timestamp when the window resets |
429 Too Many Requests status. Implement exponential backoff in your integrations.
Error Handling
Env uses standard HTTP status codes and returns detailed JSON error objects.
| Code | Meaning | Action |
|---|---|---|
| 400 | Bad Request | Check request body and parameters |
| 401 | Unauthorized | Verify your API key or token |
| 403 | Forbidden | Insufficient permissions for resource |
| 404 | Not Found | Resource or endpoint doesn't exist |
| 429 | Too Many Requests | Slow down and implement backoff |
| 500 | Server Error | Temporary issue. Retry after delay |
{
"error": {
"code": "invalid_api_key",
"message": "The provided API key is invalid or expired.",
"status": 401,
"request_id": "req_8f3k29d0s82"
}
}
SDKs & Libraries
Accelerate development with official Env SDKs for popular languages and frameworks.
npm install @env/sdk
pip install env-py
gem install env-ruby
Visit our GitHub repository → for full SDK documentation, examples, and community support.