Open private examples with your own API key

Copy-ready requests (Bash / POSIX shell)

These examples use YOUR_API_KEY. An active, provisioned subscription is required for personalized examples. Manage your subscription and key.

Show example requests

1. Discover factors

curl --request GET 'https://api.carbonnode.co.uk/api/factors?year=latest' \
  --header 'Ocp-Apim-Subscription-Key: YOUR_API_KEY' \
  --header 'Accept: application/json'

2. Smart Lookup (LLM factor finder)

curl --request POST 'https://api.carbonnode.co.uk/api/factors/smart-lookup' \
  --header 'Ocp-Apim-Subscription-Key: YOUR_API_KEY' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-raw '{"year":"latest","query":"Mains natural gas heating kWh"}'

3. Calculate an activity

curl --request POST 'https://api.carbonnode.co.uk/api/calculate/emission' \
  --header 'Ocp-Apim-Subscription-Key: YOUR_API_KEY' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-raw '{"year":"latest","factor_id":"REPLACE_WITH_ID_FROM_FACTORS","quantity":100}'

4. Calculate a batch

curl --request POST 'https://api.carbonnode.co.uk/api/calculate/batch' \
  --header 'Ocp-Apim-Subscription-Key: YOUR_API_KEY' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-raw '{"year":"latest","line_items":[{"ref":"activity-1","factor_id":"REPLACE_WITH_ID_FROM_FACTORS","quantity":100}]}'

Replace the factor ID with one returned by /factors or /factors/smart-lookup. Quantities must use that factor's published unit. Requests consume your plan's quota.

Four Endpoints. One Auditable Workflow.

Authenticate every request with Ocp-Apim-Subscription-Key against your published APIM gateway (/api). Never embed your subscription key in browser JavaScript or public repositories.

Method Path Purpose Tier Availability
GET /factors?year=latest Discover conversion factors, units (uom), and IDs for a pinned year. Hobby (Scope 1/2 sandbox), Pro & Enterprise (Full Scope 1/2/3)
POST /factors/smart-lookup LLM-powered natural-language lookup returning the best matching UK factor + alternatives. Hobby (2 / 10 min, 5 / day trial), Pro (2,500 / day), Enterprise (15,000 / day)
POST /calculate/emission Calculate kg_co2e for one activity using an ID from /factors or /factors/smart-lookup. Hobby (Sandbox IDs), Pro & Enterprise (All IDs)
POST /calculate/batch Calculate 1–100 activities in one call with Scope 1/2/3 and total kg_co2e. Hobby (Sandbox IDs), Pro & Enterprise (All IDs)

1. Discover Factors — GET /factors

Returns year, source, sandbox, and groups (scope → activity_types → items with id, label, uom, ghgConversionFactor, source).

Hobby sees the approved Scope 1/2 sandbox dataset; Pro/Enterprise see all published UK DESNZ kg CO₂e factors.

2. Smart Lookup (AI) — POST /factors/smart-lookup

{ "year": "latest", "query": "Mains natural gas heating kWh", "scope": "Scope 1" }

Returns matched_factor (including id, uom, catalog_id, catalog_url), confidence, reasoning, and alternatives. Heavily rate-limited on Hobby free tier to prevent abuse.

3. Single Calculation — POST /calculate/emission

{ "year": "latest", "factor_id": "REPLACE_WITH_ID_FROM_FACTORS", "quantity": 100 }

Always pass quantity in the factor's published uom—the API does not infer or convert units. Returns kg_co2e = quantity × conversionFactor (6 d.p.).

4. Batch Calculation — POST /calculate/batch

{ "year": "latest", "line_items": [
  { "ref": "activity-1", "factor_id": "REPLACE_WITH_ID_FROM_FACTORS", "quantity": 100 }
] }

Up to 100 lines per call (counts as 1 API call). Check every line's ok flag—failed lines are excluded from Scope totals.

Predictable Limits & Anti-Abuse Quotas

  • Hobby (Free): 1 call/min & 200 calls/day general; Smart Lookup capped at 2 calls / 10 min & 5 calls / 24h (sandbox Scope 1/2 with attribution).
  • Pro (£79/mo): 120 calls/min & 100,000 calls per rolling 30-day window; Smart Lookup 30/min & 2,500/day. No automatic overage charges at launch.
  • Enterprise: Negotiated limits and SLA; not an unlimited fallback.
  • 429 Throttling: Respect Retry-After, X-RateLimit-Remaining, and X-SmartLookup-Remaining-Day.
  • Status Codes: 400 invalid input · 401/403 key/quota · 404 unpublished year/factor · 422 overflow/non-numeric · 503 service unavailable.

Reporting Responsibly (UK SECR / GHG Protocol)

Every response identifies the exact dataset in source (e.g. UK Government GHG Conversion Factors 2026) and resolved year.

Pin an explicit four-digit year after discovery and retain requests, responses, source references, and your organisational boundary decisions.

Compare plans · Open API keys & usage

Using AI Agents? Connect via Remote MCP Server

Use your same API key on https://carbonnode.co.uk/mcp (Streamable HTTP) with Claude, Microsoft Copilot Studio, Cursor, or VS Code.

View MCP Setup & Examples →