# CBAM Calculator: EU carbon border cost per CN code (`cbamdata/cbam-calculator`) Actor

CBAM cost, certificates and embedded emissions for each import line, from the EU default values. Give a CN code, origin, tonnes and year. Needs a CBAM Data API key.

- **URL**: https://apify.com/cbamdata/cbam-calculator.md
- **Developed by:** [CBAM Data](https://apify.com/cbamdata) (community)
- **Categories:** Developer tools, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 92.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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

## CBAM Calculator

This actor tells you what each import line will cost under the EU Carbon Border Adjustment Mechanism (CBAM, Reg (EU) 2023/956). Put in a CN code, the country of origin, the tonnes and the year. Out come the embedded emissions, the certificates you have to surrender and the cost in euro, plus the official source row behind every number.

It calls the [CBAM Data](https://cbamdata.eu) API, so you need a CBAM Data API key. The actor itself is free to run on Apify. The key comes with the Developer plan: [cbamdata.eu/pricing](https://cbamdata.eu/pricing).

### Quick start

1. Get a key at [cbamdata.eu/keys](https://cbamdata.eu/keys). It starts with `cbam_live_`.
2. Paste it in the **CBAM Data API key** field. Apify stores it encrypted.
3. Put your import lines in **Import lines** and start the run.

```json
{
  "apiKey": "cbam_live_...",
  "rows": [
    { "cn": "72083900", "origin": "TR", "tonnes": 100, "year": 2026 },
    { "cn": "76011010", "origin": "IN", "tonnes": 25, "year": 2027 }
  ]
}
```

One line in, one dataset row out. Export the dataset as CSV, Excel or JSON.

### Output fields

| Field | What it is |
| --- | --- |
| `status` | `ok`, `partial` (the code needs more digits) or `error` |
| `sector` | Iron and steel, aluminium, cement, fertilisers, hydrogen or electricity |
| `emissionsPerTonne` | Embedded tCO2e per tonne, with the default value mark-up |
| `totalEmissions` | tCO2e for the whole line |
| `certificates` | CBAM certificates to surrender, after the free allocation adjustment |
| `certificatePrice`, `pricePeriod` | The latest published certificate price it used |
| `costEur` | What the line costs you in euro |
| `thresholdApplies` | Whether the 50 t a year importer threshold can exempt you |
| `declarationDeadline` | When the CBAM declaration for that year is due |
| `dataVersion` | The dataset version that gave the answer |
| `result` | The full API answer, with the source trail: regulation, annex, Official Journal link and workbook row |

A code that isn't in CBAM, or a value the Commission hasn't published, comes back as an `error` row with its code (`OUT_OF_SCOPE`, `NO_DEFAULT`). The API never makes up a number to fill a gap.

### Optional fields per line

- `route`: the production route, when the default values list more than one for the code.
- `carbonPricePaid`: the carbon price already paid in the country of origin, in EUR per tCO2e (Art. 9). It comes off the cost.
- `actual`: your supplier's measured emissions per tonne, as `{"direct": 1.8, "indirect": 0.2}` (Art. 7). With it, the default values and their mark-up aren't used.

### Sources

The defaults are the Commission's published values (Reg (EU) 2025/2621 as amended by 2026/1740), with the CN scope from Annex I and the benchmarks from Reg (EU) 2025/2620. When the Commission changes a value, CBAM Data ships a new dataset version and logs the change at [cbamdata.eu/changes](https://cbamdata.eu/changes). The `dataVersion` column names the version behind the answer.

### Without a key

The run stops at the start and tells you where to get one. No key, no calls.

### Other ways to reach the same data

- The HTTP API, one GET per line: [cbamdata.eu/docs](https://cbamdata.eu/docs)
- An MCP server for AI agents: `npx -y @cbamdata/mcp`
- The free calculator in the browser: [cbamdata.eu](https://cbamdata.eu)

### Limits

These are estimates from default values. They don't replace a verified declaration. Actual emissions you pass in are taken as you give them, and nobody checks them for you. CBAM Data isn't linked to the European Commission.

# Actor input Schema

## `apiKey` (type: `string`):

Your key from cbamdata.eu (it starts with cbam_live\_). The API is the Developer plan: https://cbamdata.eu/pricing. Create a key at https://cbamdata.eu/keys.

## `rows` (type: `array`):

One object per import line: cn (CN code, 4 to 10 digits), origin (2-letter country code), tonnes (net mass, or MWh for electricity) and year (2026 to 2034). Optional: route, carbonPricePaid (EUR per tCO2e paid at origin).

## Actor input object example

```json
{
  "rows": [
    {
      "cn": "72083900",
      "origin": "TR",
      "tonnes": 100,
      "year": 2026
    },
    {
      "cn": "76011010",
      "origin": "IN",
      "tonnes": 25,
      "year": 2027
    }
  ]
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# 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 = {
    "rows": [
        {
            "cn": "72083900",
            "origin": "TR",
            "tonnes": 100,
            "year": 2026
        },
        {
            "cn": "76011010",
            "origin": "IN",
            "tonnes": 25,
            "year": 2027
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("cbamdata/cbam-calculator").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 = { "rows": [
        {
            "cn": "72083900",
            "origin": "TR",
            "tonnes": 100,
            "year": 2026,
        },
        {
            "cn": "76011010",
            "origin": "IN",
            "tonnes": 25,
            "year": 2027,
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("cbamdata/cbam-calculator").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 '{
  "rows": [
    {
      "cn": "72083900",
      "origin": "TR",
      "tonnes": 100,
      "year": 2026
    },
    {
      "cn": "76011010",
      "origin": "IN",
      "tonnes": 25,
      "year": 2027
    }
  ]
}' |
apify call cbamdata/cbam-calculator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,cbamdata/cbam-calculator"
        }
    }
}
```

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/8gcgCLAYmddXZHhOs/builds/cheOkqevNUQsZLhyN/openapi.json
