5 minute setup

Quick Start Guide

Get up and running with the ZeroCarbon API in under 5 minutes.

1

Get API Key

Sign up and generate your key

2

Install SDK

npm install or pip install

3

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:

  1. Log in to your ZeroCarbon dashboard at app.zerocarbon.org.in
  2. Navigate to Settings → Billing → API Keys
  3. Click "Create New API Key"
  4. Choose Test (zc_test_) or Live (zc_live_) mode
  5. 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

terminalbash
npm install zerocarbon-nodejs-sdk dotenv
# or
pnpm add zerocarbon-nodejs-sdk dotenv
# or
yarn add zerocarbon-nodejs-sdk dotenv

Python

terminalbash
pip install zerocarbon-python-sdk python-dotenv

Step 3: Submit Your First Activity

Node.js / TypeScript Example

index.tstypescript
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

main.pypython
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?

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

ZeroCarbon | India's Carbon Accounting & BRSR Reporting Software