App Pattern: Carbon Dashboard (Read + Attest + Visualise)
🏗️ Module 8: Build Real Apps
App Pattern: Carbon Dashboard (Read + Attest + Visualise)
This is the app Khazna wants. A dashboard that shows real-time carbon emissions, backed by cryptographic proof.
You're combining 3 things: Read meter data, Attest the carbon, Visualise the results.
Step 1: Read Meter Data
First, grab the latest readings from your grid connection:
curl -s https://app.energyatit.com/api/v1/grid-connections/1/meter-readings \
-H "Authorization: Bearer $TOKEN" | jq '.data'curl.exe -H "Authorization: Bearer $env:TOKEN" "https://app.energyatit.com/api/v1/grid-connections/1/meter-readings" | ConvertFrom-Json | ConvertTo-Json -Depth 10This gives you kWh consumed, timestamps, and power readings.
Step 2: Create a Carbon Attestation
Now take that meter reading and turn it into a hash-chained carbon record:
curl -s -X POST https://app.energyatit.com/api/v1/carbon/record \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"meter_id": "METER-001",
"facility_id": "YOUR_FACILITY_UUID",
"timestamp": "2026-02-27T10:00:00Z",
"kwh": 1250.5,
"grid_zone": "UAE"
}'curl.exe --% -X POST -H "Authorization: Bearer $env:TOKEN" -H "Content-Type: application/json" -d "{"meter_id": "METER-001", "facility_id": "YOUR_FACILITY_UUID", "timestamp": "2026-02-27T10:00:00Z", "kwh": 1250.5, "grid_zone": "UAE"}" "https://app.energyatit.com/api/v1/carbon/record"The platform automatically looks up the carbon intensity for your grid zone and calculates emissions. Each record is SHA-256 hashed and chained to the previous one. Nobody can tamper with it.
Step 3: Verify the Chain
curl -s https://app.energyatit.com/api/v1/carbon/verify/METER-001 \
-H "Authorization: Bearer $TOKEN"curl.exe -H "Authorization: Bearer $env:TOKEN" "https://app.energyatit.com/api/v1/carbon/verify/METER-001"If every hash matches, you get "chain_valid": true. This is your proof — auditable, tamper-evident, ready for compliance.
Step 4: Display It
With Python, pull the facility summary and build your dashboard data:
from energyatit import EnergyAtItClient
client = EnergyAtItClient(token="your_token")
summary = client.get_carbon_summary("YOUR_FACILITY_UUID")
print(f"Total kWh: {summary['total_kwh']:,.0f}")
print(f"Total CO2e: {summary['total_co2e_kg']:,.1f} kg")
print(f"Records: {summary['record_count']}")Why Khazna Cares
Khazna operates data centers. Their tenants ask: "What's my carbon footprint?" Without this dashboard, Khazna's team spends days pulling spreadsheets. With it, tenants get real-time, verifiable numbers. That's the job you're applying for.
Log in to track your progress and earn certifications.