Back to Guides

ESG Reporting

Carbon tracking and sustainability metrics

Overview

Track carbon intensity, calculate avoided emissions, and generate sustainability reports for corporate ESG disclosure. Our data comes from National Grid ESO and updates every 30 minutes.

Key Metrics

Carbon Intensity

gCO2 emitted per kWh of electricity consumed. UK average is ~180 gCO2/kWh, ranging from 50-400 depending on fuel mix.

Avoided Emissions

CO2 not emitted due to renewable generation displacing fossil fuels. Key metric for Scope 2 reporting.

Fuel Mix

Percentage breakdown of generation sources: wind, solar, gas, nuclear, imports, biomass, hydro.

Regional Carbon

Carbon intensity varies by UK region. Scotland typically has lower intensity due to more wind.

Carbon Intensity

Get real-time and forecasted grid carbon intensity.

typescript
import { EnergyOracle } from '@energyoracle/sdk';

const oracle = new EnergyOracle({ apiKey: 'your-key' });

// Get current carbon intensity
const carbon = await oracle.uk.carbon.current();

console.log(`Intensity: ${carbon.intensity} gCO2/kWh`);
console.log(`Index: ${carbon.index}`);  // very low, low, moderate, high, very high

// Get 48-hour forecast
const forecast = await oracle.uk.carbon.forecast();
forecast.forEach(period => {
  console.log(`${period.datetime}: ${period.intensity} gCO2/kWh (${period.index})`);
});

Generation Fuel Mix

Track the percentage breakdown of electricity generation by source.

typescript
// Get current generation fuel mix
const fuelMix = await oracle.uk.carbon.fuelMix();

console.log(`Wind: ${fuelMix.wind}%`);
console.log(`Solar: ${fuelMix.solar}%`);
console.log(`Gas: ${fuelMix.gas}%`);
console.log(`Nuclear: ${fuelMix.nuclear}%`);
console.log(`Imports: ${fuelMix.imports}%`);

// Renewable percentage
const renewables = fuelMix.wind + fuelMix.solar + fuelMix.hydro + fuelMix.biomass;
console.log(`Renewables: ${renewables.toFixed(1)}%`);

Regional Carbon Intensity

Carbon intensity varies significantly by UK region. Use postcode or region lookup for location-specific reporting.

typescript
// Get carbon intensity for all 14 UK regions
const regional = await oracle.uk.carbon.regional();

regional.forEach(region => {
  console.log(`${region.name}: ${region.intensity} gCO2/kWh (${region.index})`);
});

// Get carbon by postcode
const local = await oracle.uk.carbon.byPostcode('SW1A 1AA');
console.log(`Westminster: ${local.intensity} gCO2/kWh`);

// Get carbon by DNO region
const dno = await oracle.uk.carbon.byRegion('South England');
console.log(`South England: ${dno.intensity} gCO2/kWh`);

UK Regions: North Scotland, South Scotland, North West England, North East England, Yorkshire, North Wales, South Wales, West Midlands, East Midlands, East England, South West England, South England, London, South East England

Calculating Avoided Emissions

Calculate the CO2 emissions avoided by renewable generation.

typescript
// Calculate avoided emissions for renewable generation

// Method 1: Using API
const avoided = await oracle.uk.analytics.avoidedEmissions({
  generationMwh: 1000,
  technology: 'wind',
  period: { year: 2024, month: 12 }
});

console.log(`Avoided: ${avoided.tCO2e} tonnes CO2e`);
console.log(`Grid average: ${avoided.gridAverageIntensity} gCO2/kWh`);

// Method 2: Manual calculation
const prices = await oracle.uk.prices.range('2024-12-01', '2024-12-31');
const carbon = await oracle.uk.carbon.range('2024-12-01', '2024-12-31');

// Merge and calculate
const merged = prices.map((p, i) => ({
  ...p,
  intensity: carbon[i].intensity
}));

// Weight by generation profile
const avgIntensity = merged.reduce((sum, p) => sum + p.intensity, 0) / merged.length;
const avoidedTonnes = (avgIntensity * 1000) / 1000; // MWh * gCO2/kWh = kg, /1000 = tonnes

Generating ESG Reports

Combine multiple metrics into comprehensive ESG reports.

typescript
import { EnergyOracle } from '@energyoracle/sdk';

const oracle = new EnergyOracle({ apiKey: 'your-key' });

async function generateESGReport(year: number, month: number) {
  // Gather all data
  const [carbon, fuelMix, prices, avoided] = await Promise.all([
    oracle.uk.carbon.monthlyAverage(year, month),
    oracle.uk.carbon.monthlyFuelMix(year, month),
    oracle.uk.prices.monthlyAverage(year, month),
    oracle.uk.analytics.avoidedEmissions({
      generationMwh: companyGenerationMwh,
      technology: 'wind',
      period: { year, month }
    })
  ]);

  return {
    period: `${year}-${month.toString().padStart(2, '0')}`,
    environmental: {
      avgCarbonIntensity: carbon.avgIntensity,
      renewablePercentage: fuelMix.wind + fuelMix.solar + fuelMix.hydro,
      avoidedEmissionsTonnes: avoided.tCO2e,
      equivalentCarsOffRoad: Math.round(avoided.tCO2e / 4.6), // UK avg car ~4.6t/year
    },
    market: {
      avgPrice: prices.avgPrice,
      greenPremium: prices.greenPremium,
    },
    methodology: {
      source: 'EnergyOracle API',
      carbonDataSource: 'National Grid ESO',
      priceDataSource: 'Elexon BMRS',
      timestamp: new Date().toISOString()
    }
  };
}

Annual Report with Python

Generate annual trend analysis with Pandas export to CSV/Excel.

python
from energyoracle import EnergyOracle
import pandas as pd

oracle = EnergyOracle(api_key="your-key")

# Get monthly data for a year
months = []
for month in range(1, 13):
    carbon = oracle.uk.carbon.monthly_average(2024, month)
    fuel_mix = oracle.uk.carbon.monthly_fuel_mix(2024, month)

    months.append({
        "month": f"2024-{month:02d}",
        "avg_carbon": carbon.avg_intensity,
        "min_carbon": carbon.min_intensity,
        "max_carbon": carbon.max_intensity,
        "renewable_pct": fuel_mix.wind + fuel_mix.solar + fuel_mix.hydro,
        "wind_pct": fuel_mix.wind,
        "solar_pct": fuel_mix.solar,
    })

df = pd.DataFrame(months)

# Calculate trends
df["carbon_trend"] = df["avg_carbon"].pct_change() * 100
df["renewable_trend"] = df["renewable_pct"].pct_change() * 100

# Export for reporting
df.to_csv("esg_annual_report.csv", index=False)
df.to_excel("esg_annual_report.xlsx", index=False)

# Summary statistics
print(f"Annual avg carbon: {df['avg_carbon'].mean():.0f} gCO2/kWh")
print(f"Annual avg renewables: {df['renewable_pct'].mean():.1f}%")
print(f"Carbon reduction: {((df['avg_carbon'].iloc[0] - df['avg_carbon'].iloc[-1]) / df['avg_carbon'].iloc[0] * 100):.1f}%")

Real-Time Carbon Badge

Display live carbon intensity on your website or dashboard.

tsx
// React component for real-time carbon badge
import { useEffect, useState } from 'react';
import { EnergyOracle } from '@energyoracle/sdk';

function CarbonBadge() {
  const [carbon, setCarbon] = useState(null);

  useEffect(() => {
    const oracle = new EnergyOracle({ apiKey: 'your-key' });

    // Initial fetch
    oracle.uk.carbon.current().then(setCarbon);

    // Subscribe to updates
    const unsubscribe = oracle.uk.carbon.subscribe(setCarbon);
    return unsubscribe;
  }, []);

  if (!carbon) return <div>Loading...</div>;

  const colors = {
    'very low': '#00FF88',
    'low': '#7FFF7F',
    'moderate': '#FFD700',
    'high': '#FF7F50',
    'very high': '#FF4444'
  };

  return (
    <div style={{ backgroundColor: colors[carbon.index] }}>
      <span>{carbon.intensity} gCO2/kWh</span>
      <span>{carbon.index}</span>
    </div>
  );
}

Carbon Intensity Index

Very Low
<75 gCO2/kWh
Low
75-150
Moderate
150-250
High
250-350
Very High
>350

Next Steps