# Emission Factors API: DEFRA, EPA & Grid CO2e Calculator (`reliable_tools/emission-factors-api`) Actor

Emission factor lookup and CO2e calculator on public open data: UK DESNZ (DEFRA), US EPA, EEA and Ember grid factors. Scope, GHG category, formula and source per activity. Not affiliated with DEFRA or EPA.

- **URL**: https://apify.com/reliable_tools/emission-factors-api.md
- **Developed by:** [Reliable Tools](https://apify.com/reliable_tools) (community)
- **Categories:** Developer tools, Other
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $17.00 / 1,000 activity calculateds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Emission Factors API: DEFRA, EPA & Grid CO2e Calculator

Not affiliated with DESNZ/DEFRA, EPA, EEA or Ember; not an assurance of your reporting.

This emission factor lookup turns your activity data into kg CO2e with official, open emission factors: the UK
Government GHG conversion factors (DESNZ, formerly DEFRA), the US EPA GHG Emission Factors Hub, EEA and Ember grid
electricity factors, and EPA spend-based supply chain factors. Write the activity the way you have it ("500 km diesel
van", "1200 kWh electricity Germany 2025", "3 t steel", "flight LHR-JFK economy") and get the factor, its scope and
GHG Protocol category, the formula, the source table and year, the licence, the alternatives that were considered and
an AI match score for the text-to-factor mapping.

Every factor value comes from an official file. Where a source publishes another unit, the value is converted in
code and the row says so: EEA and Ember values are converted to kg CO2e/kWh (published as g CO2e/kWh), EPA eGRID values
from lb per MWh and EPA waste values from metric tons. The AI only chooses among real factor rows and rates how well the
chosen row fits your text. It never writes a number. For this step your activity text is sent to an external AI service
for this fixed comparison only; turn off **AI match score** to use text similarity instead.

### What does Emission Factor Lookup do?

1. **Reads your activity.** Quantity and unit ("1,200 kWh", "3 t", "200 miles", "$25,000"), country, US state or eGRID
   subregion, reporting year, cabin class and passengers are read in code. Structured input works too.
2. **Finds the official factor.** Fuels, company vehicles, freight, materials, waste, refrigerants, water, hotel stays,
   rail, taxi, bus and ferry travel come from DESNZ or the EPA hub. Grid electricity comes from DESNZ for the UK, EPA
   eGRID for the US, the EEA for EU countries and Ember for 200+ other countries. Flights use the DESNZ air factors and
   the great-circle distance between the two airports.
3. **Calculates kg CO2e.** Units are converted in code (miles to km, MWh to kWh, US gallons to litres, short tons to
   tonnes) and the formula is shown: `500 km x 0.25716 kg CO2e per km = 128.58 kg CO2e`.
4. **Documents it.** Scope 1, 2 or 3, the GHG Protocol category, the dataset, publisher, year, table, row ID, source
   page, licence and attribution, plus an audit trail sentence you can paste into a CSRD, SECR or CDP methodology note.

### Who uses it?

- **Carbon accounting and ESG software teams** that need a factor API with an audit trail behind every number.
- **CSRD, SECR and CDP reporting teams** turning fuel bills, meter readings, mileage claims and travel bookings into a
  Scope 1, 2 and 3 inventory.
- **Logistics, procurement and travel managers** estimating freight, purchase and flight emissions.
- **AI agents and sustainability assistants** that must answer "how much CO2e is this?" with a citable source.

### What data you get

| Field | What it is |
|---|---|
| `status` | `calculated`, `factor_returned` (no quantity given), `not_found`, `needs_country`, `invalid_input` or `error` |
| `kgCO2e`, `tCO2e` | The result in kg and tonnes CO2e |
| `formula` | Quantity x factor = result, in the factor's unit |
| `factor.name` | The official row, for example `Delivery vehicles > Vans > Average (up to 3.5 tonnes) > Diesel` |
| `factor.value`, `factor.unit` | The factor in kg CO2e, for example `0.25716` kg CO2e per km |
| `factor.gasesKgCO2ePerUnit` | CO2, CH4 and N2O parts of the factor, where the source publishes them |
| `factor.otherUnits` | The same factor in its other published units (litres, kWh, tonnes) |
| `factor.scope`, `factor.ghgProtocolCategory` | Scope 1, 2 or 3 and the category, for example Scope 3 Category 6: business travel |
| `factor.dataset`, `publisher`, `datasetYear`, `table`, `rowId`, `sourceUrl` | Where the number comes from |
| `factor.licence`, `factor.licenceUrl`, `factor.attribution` | Licence of the source, a link to the licence text and the attribution text to use |
| `factor.conversionNote` | For EEA and Ember grid factors: values converted to kg CO2e/kWh |
| `factor.basis` | Method notes, for example lifecycle versus combustion-only grid factors |
| `quantity` | Your quantity in the factor's unit, with the conversion |
| `gasesKgCO2e` | CO2, CH4 and N2O share of the result |
| `matchScore`, `matchMethod` | How well the factor row fits your activity (0 to 1) and how it was chosen |
| `reviewRecommended` | `true` when a person should check the choice before reporting |
| `alternatives` | Other rows that were considered, with their value and kg CO2e |
| `upstreamFactors` | Well-to-tank and grid loss factors of the same item (Scope 3 Category 3), with kg CO2e |
| `flight` | Airports, countries, great-circle km, DESNZ haul, cabin, passengers, return trip |
| `yearRequested`, `yearUsed` | The reporting year you asked for and the factor set used |
| `auditTrail` | One paragraph for your methodology appendix |

### Sources and licences

| Source | What it covers | Years | Licence |
|---|---|---|---|
| UK Government GHG Conversion Factors for Company Reporting (DESNZ, formerly DEFRA), flat files | Fuels, bioenergy, refrigerants, cars, vans, HGVs, freight, rail, bus, taxi, ferry, flights, hotel stays, materials, waste, water, heat, UK electricity, well-to-tank, T\&D | 2014 to 2026 | Open Government Licence v3.0 (www.nationalarchives.gov.uk/doc/open-government-licence/version/3) |
| US EPA GHG Emission Factors Hub | Stationary combustion, mobile CO2, non-road vehicles, eGRID electricity by subregion, steam, freight, waste, business travel | 2022 onwards, as published | Public domain (US federal government work) |
| EEA, greenhouse gas emission intensity of electricity generation | EU-27 grid electricity by country | 1990 onwards | CC BY 4.0, EEA legal notice (www.eea.europa.eu/en/legal-notice); values converted to kg CO2e/kWh |
| Ember Yearly Electricity Data | Grid electricity CO2 intensity for 200+ countries (lifecycle basis) | 2000 onwards | CC BY 4.0 (creativecommons.org/licenses/by/4.0); values converted to kg CO2e/kWh |
| EPA Supply Chain GHG Emission Factors v1.3 (USEEIO) | Spend-based factors by NAICS industry, kg CO2e per 2022 US dollar | 2022 dollars | Public domain (US federal government work) |
| OurAirports | Airport coordinates for flight distances | current | Public domain |

The Actor downloads these official files, keeps a parsed copy for up to 30 days and refreshes it from the source after
that. Paid databases (ecoinvent, IEA, Climatiq) are not used. The IPCC Emission Factor Database is not included because
its terms do not allow commercial reuse without permission.

### How to calculate emissions step by step

1. Open the Actor and put your activities into **Activities**, one per line, as text or objects.
2. Set a **Default country** if most of your data is from one country, and a **Default reporting year**.
3. Click **Start**. In our tests 40 activities took about 10 seconds and 188 activities under 70 seconds.
4. Download the results as JSON, CSV or Excel, or read them through the Apify API.

### Input examples

```json
{
  "activities": [
    "500 km diesel van",
    "1200 kWh electricity Germany 2025",
    "3 t steel",
    "flight LHR-JFK economy return",
    "$25,000 office furniture",
    {"reference": "INV-17", "category": "natural gas", "quantity": 18000, "unit": "kWh", "country": "UK", "year": 2025},
    {"reference": "T-9", "from": "FRA", "to": "SIN", "passengers": 2, "activity": "business class"}
  ],
  "defaultCountry": "UK"
}
```

Recognised units include kWh, MWh, GJ, therms, mmBtu, litres, cubic metres, US and UK gallons, scf, kg, tonnes, short
tons, lb, km, miles, passenger.km, tonne.km, ton-miles, room nights, FTE working hours and USD.

### Example output

```json
{
  "reference": "1",
  "activity": "500 km diesel van",
  "status": "calculated",
  "kgCO2e": 128.58,
  "tCO2e": 0.12858,
  "formula": "500 km x 0.25716 kg CO2e per km = 128.5800 kg CO2e",
  "factor": {
    "name": "Delivery vehicles > Vans > Average (up to 3.5 tonnes) > Diesel",
    "value": 0.25716,
    "unit": "kg CO2e per km",
    "scope": "1",
    "ghgProtocolCategory": "Scope 1: mobile combustion (company-owned or controlled vehicles)",
    "dataset": "UK Government GHG Conversion Factors for Company Reporting",
    "datasetYear": 2026,
    "table": "Factors by Category",
    "rowId": "5_303_3102_4",
    "licence": "Open Government Licence v3.0"
  },
  "matchScore": 0.92,
  "matchMethod": "AI match over official factor rows",
  "reviewRecommended": false,
  "alternatives": [
    {"name": "Delivery vehicles > Vans > Class III (1.74 to 3.5 tonnes) > Diesel", "value": 0.28046, "kgCO2e": 140.23}
  ],
  "upstreamFactors": [
    {"name": "WTT- delivery vehs & freight > WTT- vans > Average (up to 3.5 tonnes) > Diesel", "value": 0.06128, "kgCO2e": 30.64}
  ]
}
```

### How the factor choice works

- **Rules in code** decide grid electricity (by country and year), flights (airport distance, DESNZ haul definition,
  cabin class, radiative forcing) and hotel stays (by country).
- **For everything else** code lists the official rows that fit your unit, an AI picks the kind of factor and then the
  best row, and rates how well that row fits your text from 0 to 1. Code then decides: below 0.5 the row is reported as
  `not_found` with the closest rows as alternatives and is not charged; from 0.5 to 0.7 `reviewRecommended` is `true`.
- **US activities** search the EPA hub first and UK and other activities search DESNZ first; the other set is searched
  when the first has no good match. You can change this with **Preferred factor set**.
- **The reporting year** picks the factor set of that year. When it is not published yet, the latest earlier set is
  used and the note says so.

### API use

```bash
curl -X POST "https://api.apify.com/v2/acts/reliable_tools~emission-factors-api/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"activities": ["10000 litres diesel 2025", "5000 kWh electricity UK 2025"]}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_TOKEN")
run = client.actor("reliable_tools/emission-factors-api").call(run_input={
    "activities": ["500 km diesel van", "flight LHR-JFK economy"]})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["activity"], row["kgCO2e"], row["factor"]["name"] if row["factor"] else row["note"])
```

### Pricing

Pay per event, no subscription:

| Event | Price |
|---|---|
| Activity calculated (factor, kg CO2e, formula, scope, source, alternatives, audit trail) | $0.02 |
| Factor returned (activity without a quantity) | $0.005 |
| Actor start | $0.00005 per run |

Rows with no suitable factor, a missing country, invalid input or a source error are free.

### FAQ

**Where do the DEFRA conversion factors come from?** Data copied from the UK Government's public GHG conversion factor
flat files on GOV.UK; not affiliated with or endorsed by DESNZ/DEFRA. Since 2023 the UK factors are published by the
Department for Energy Security and Net Zero (DESNZ); they are the same series that used to be called DEFRA factors.
The Actor reads the flat file of each year from 2014 to 2026. The results support your reporting but are not an
assurance of it.

**Which electricity factor do I get?** A location-based Scope 2 factor: DESNZ for the UK, EPA eGRID for the US (by state
or subregion when you name one, else the US average), the EEA for EU countries and Ember for other countries. Ember
factors are lifecycle factors and are higher than combustion-only factors; the `basis` field says which one you got. For
market-based Scope 2 use your supplier's factor.

**Does it include well-to-tank and grid losses?** They are always listed under `upstreamFactors` with their kg CO2e. Turn
on **Add upstream emissions to the total** to add them to `kgCO2e`.

**How are flight emissions calculated?** Great-circle distance between the two IATA airports, the DESNZ haul (domestic,
short-haul, long-haul or international between non-UK airports) and cabin class. The DESNZ factors already include an 8
percent distance uplift, so none is added. Radiative forcing is included by default, as DESNZ recommends.

**What if my van is not company-owned?** Pass `"scope": 3` on the activity. The factor stays the same and the result is
reported as Scope 3 (Category 4 for vans and HGVs, Category 6 for cars).

**Can I use spend data?** Yes, in US dollars: "$25,000 office furniture" uses the EPA spend-based factor of the matching
NAICS industry, per 2022 dollar at purchaser price. Other currencies are not converted.

**How accurate is the match?** We tested 40 activities across fuels, vehicles, freight, materials, waste, electricity
in 10 countries, flights, hotels and spend, and checked factor values by hand against the official spreadsheets. Rows
with a lower match score are flagged with `reviewRecommended`, and spend categories that sit close together (for example
furniture makers and furniture wholesalers) can swap, so check the alternatives before you report.

**Something missing or wrong?** Open an issue on the Issues tab and we will look at it.

### About Reliable Tools

This Actor is made by [Reliable Tools](https://apify.com/reliable_tools). We build data tools that return clean,
sourced data plus an AI label with a confidence score, so you can filter and act on the results straight away.

If a factor is missing or an activity does not match the way you expect, open an issue on the Issues tab. We read every
one and usually reply within a day. You can find our other Actors on our [profile page](https://apify.com/reliable_tools).

# Actor input Schema

## `activities` (type: `array`):

One entry per activity. Plain text such as "500 km diesel van", "1200 kWh electricity Germany 2025", "3 t steel", "flight LHR-JFK economy return" or "$25,000 office furniture". Or an object with "activity" (or "category"), "quantity", "unit", "country", "year", "scope", "reference"; for flights "from" and "to" (IATA codes) and "passengers". Without a quantity you get the factor only.

## `csvUrl` (type: `string`):

Optional: a link to a CSV file with a header row. Recognised columns: activity (or description), category, quantity, unit, country, year, scope, reference, from, to, passengers.

## `defaultCountry` (type: `string`):

Used when an activity names no country, for example UK, US or Germany. Grid electricity and hotel stays need a country.

## `defaultYear` (type: `integer`):

Used when an activity names no year. Without it the latest published factor set is used.

## `preferredSource` (type: `string`):

Which official set to search first for fuels, vehicles, freight, waste and travel. The other set is searched when the first has no good match.

## `aviationRadiativeForcing` (type: `boolean`):

Uses the DESNZ air factors that include the indirect effects of non-CO2 emissions, as DESNZ recommends. Turn off for direct emissions only.

## `includeUpstream` (type: `boolean`):

Adds the well-to-tank and grid loss factors of the same item (Scope 3 Category 3) to kgCO2e. They are always listed under upstreamFactors.

## `maxAlternatives` (type: `integer`):

Other factor rows that were considered, with their value and kgCO2e.

## `aiMatching` (type: `boolean`):

Picks the best official factor row for your text and rates the fit from 0 to 1. Off: text similarity only, no match score.

## `maxActivities` (type: `integer`):

Stops after this many activities.

## Actor input object example

```json
{
  "activities": [
    "500 km diesel van",
    "1200 kWh electricity Germany 2025",
    "3 t steel",
    "flight LHR-JFK economy",
    {
      "reference": "INV-17",
      "category": "natural gas",
      "quantity": 18000,
      "unit": "kWh",
      "country": "UK",
      "year": 2025
    }
  ],
  "preferredSource": "auto",
  "aviationRadiativeForcing": true,
  "includeUpstream": false,
  "maxAlternatives": 3,
  "aiMatching": true,
  "maxActivities": 5000
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset in the emissions view.

## `summary` (type: `string`):

Counts per status and the dataset versions used.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "activities": [
        "500 km diesel van",
        "1200 kWh electricity Germany 2025",
        "3 t steel",
        "flight LHR-JFK economy",
        {
            "reference": "INV-17",
            "category": "natural gas",
            "quantity": 18000,
            "unit": "kWh",
            "country": "UK",
            "year": 2025
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("reliable_tools/emission-factors-api").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "activities": [
        "500 km diesel van",
        "1200 kWh electricity Germany 2025",
        "3 t steel",
        "flight LHR-JFK economy",
        {
            "reference": "INV-17",
            "category": "natural gas",
            "quantity": 18000,
            "unit": "kWh",
            "country": "UK",
            "year": 2025,
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("reliable_tools/emission-factors-api").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "activities": [
    "500 km diesel van",
    "1200 kWh electricity Germany 2025",
    "3 t steel",
    "flight LHR-JFK economy",
    {
      "reference": "INV-17",
      "category": "natural gas",
      "quantity": 18000,
      "unit": "kWh",
      "country": "UK",
      "year": 2025
    }
  ]
}' |
apify call reliable_tools/emission-factors-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,reliable_tools/emission-factors-api"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/8PQNmMe8A6YFGsr8c/builds/qVje4Xiv9Z9dZXU3v/openapi.json
