Quick Start Guide
Get up and running with the ZeroCarbon API in under 5 minutes.
Get API Key
Sign up and generate your key
Install SDK
npm install or pip install
Make Request
Submit your first activity
Step 1: Get Your API Key
📋 Prerequisites: API access requires either:
- Professional Plan (₹14,999/month) + API Add-on Pack (₹999-₹2,999/month)
- Enterprise Plan (₹39,999/month) with unlimited API keys included
Trial and Starter plans do not include API access.
Once you have an eligible plan, generate your API key:
- Log in to your ZeroCarbon dashboard at app.zerocarbon.org.in
- Navigate to Settings → Billing → API Keys
- Click "Create New API Key"
- Choose Test (zc_test_) or Live (zc_live_) mode
- Copy your API key (it's only shown once!)
⚠️ Security Best Practice
Store your API key securely. Never commit it to version control or share it publicly. Use environment variables or a secrets manager.
Step 2: Install the SDK
Node.js / TypeScript
npm install zerocarbon-nodejs-sdk dotenv
# or
pnpm add zerocarbon-nodejs-sdk dotenv
# or
yarn add zerocarbon-nodejs-sdk dotenvPython
pip install zerocarbon-python-sdk python-dotenvStep 3: Submit Your First Activity
Node.js / TypeScript Example
import { ZeroCarbon } from 'zerocarbon-nodejs-sdk';
import * as dotenv from 'dotenv';
dotenv.config();
// Initialize the client
const client = new ZeroCarbon({
apiKey: process.env.ZEROCARBON_API_KEY!,
baseUrl: 'https://api.zerocarbon.org.in/v1'
});
// Submit an electricity consumption activity
async function submitActivity() {
try {
const result = await client.emissions.calculate({
activity_type: 'electricity',
quantity: 1500,
unit: 'kWh',
period: {
start: '2026-02-01',
end: '2026-02-28'
},
location: {
country: 'IN',
state: 'MH',
city: 'Mumbai'
},
source: {
type: 'manual',
confidence: 0.95
}
});
console.log('✅ Activity submitted successfully!');
console.log(`📊 Emissions: ${result.emissions_kg_co2e} kg CO2e`);
console.log(`🎯 Confidence: ${result.confidence_score}`);
console.log(`🔗 Activity ID: ${result.activity_id}`);
} catch (error) {
console.error('❌ Error:', error);
}
}
submitActivity();Python Example
from zerocarbon import ZeroCarbon
import os
from dotenv import load_dotenv
load_dotenv()
# Initialize the client
client = ZeroCarbon(
api_key=os.getenv('ZEROCARBON_API_KEY'),
base_url='https://api.zerocarbon.org.in/v1'
)
# Submit electricity activity
result = client.emissions.calculate({
'activity_type': 'electricity',
'quantity': 1500,
'unit': 'kWh',
'period': {
'start': '2026-02-01',
'end': '2026-02-28'
},
'location': {
'country': 'IN',
'state': 'MH',
'city': 'Mumbai'
},
'source': {
'type': 'manual',
'confidence': 0.95
}
})
print('✅ Activity submitted successfully!')
print(f"📊 Emissions: {result['emissions_kg_co2e']} kg CO2e")
print(f"🎯 Confidence: {result['confidence_score']}")
print(f"🔗 Activity ID: {result['activity_id']}")What's Next?
📋 Carbon Activity Model
Understand the data structure and all available activity types
📚 API Reference
Explore all available endpoints and parameters
📊 Generate Reports
Create BRSR, GHG Protocol, and custom compliance reports
💡 Complete Examples
See full end-to-end integration examples
Helpful Tips
Always use environment variables for API keys
Never hardcode sensitive credentials in your source code
Start with the sandbox environment
Test your integration before going to production
Handle errors gracefully
Implement retry logic and proper error handling