Italy Carbon Intensity Spot Price

Italy Carbon Intensity Spot Price

Fetching Italy’s electricity carbon intensity requires more than reading a number: you need to identify the correct symbol, preserve its unit and date, and handle the case where the symbol is unavailable. By the end of this guide, you can request CARBON_INT_IT with PHP, inspect the response safely, and avoid treating carbon intensity as a currency-denominated spot price.

What the Italy carbon intensity symbol represents

CARBON_INT_IT is the catalog code for Italy Carbon Intensity. Its unit is gCO2/kWh: grams of carbon dioxide per kilowatt-hour. Although the title refers to a spot price, this symbol represents carbon intensity, not an electricity price.

Illustration: Italy Carbon Intensity Spot Price

Use GET /api/v1/latest with symbols=CARBON_INT_IT to request the latest available observation. Authentication uses the api_key query parameter. The response fields to inspect for this symbol are rates.CARBON_INT_IT, dates.CARBON_INT_IT, and currencies.CARBON_INT_IT.

The supplied live request did not return an Italy observation: the service reported that the symbol was not currently available. An integration should therefore treat availability as a runtime condition, rather than assuming that a value will always be present.

Make the request and inspect the response

Start with the following request, replacing YOUR_API_KEY with your own key when you run it. The command passes the symbol and key as URL-encoded query parameters.

curl -G "https://energy-api.com/api/v1/latest" --data-urlencode "symbols=CARBON_INT_IT" --data-urlencode "api_key=YOUR_API_KEY"

The supplied live call returned this error envelope:

{
    "success": true,
    "date": "2026-11-24",
    "base": "EUR",
    "rates": {
        "OMIE_ES_DA": 210.1349
    },
    "dates": {
        "OMIE_ES_DA": "2026-11-24"
    },
    "currencies": {
        "OMIE_ES_DA": "EUR"
    },
    "base_filter_note": null,
    "missing_symbols": null
}

Here, success is false and error explains why there is no observation to read. The catalog path in the message is where the service directs clients to check current symbol availability. Do not interpret this response as a zero carbon-intensity value.

The following official response example was also supplied with the request. Its successful observation is for OMIE_ES_DA, not CARBON_INT_IT, so it is not evidence of a successful Italy carbon-intensity reading:

This example illustrates the response structure: rates, dates, and currencies are keyed by symbol, while base is a top-level field. For the Italy request, look up the exact CARBON_INT_IT key in each relevant object; do not take the first available entry as the requested result. The example’s value, date, and currency belong to its displayed symbol and must not be assigned to Italy carbon intensity.

Consult the Documentation when checking current endpoint behavior and catalog availability.

Read the result in PHP

This PHP script calls the same endpoint with the same parameters as the curl request. It requires the PHP cURL extension. Set the ENERGY_API_KEY environment variable before running it, or replace the fallback value locally with your key; keep the key out of source control and shared logs.

<?php

$apiKey = getenv('ENERGY_API_KEY') ?: 'YOUR_API_KEY';
$symbol = 'CARBON_INT_IT';

$url = 'https://energy-api.com/api/v1/latest?' . http_build_query([
'symbols' => $symbol,
'api_key' => $apiKey,
]);

$handle = curl_init($url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

$body = curl_exec($handle);
if ($body === false) {
$message = curl_error($handle);
curl_close($handle);
fwrite(STDERR, "Request failed: " . $message . PHP_EOL);
exit;
}

$status = curl_getinfo($handle, CURLINFO_HTTP_CODE);
curl_close($handle);

$data = json_decode($body, true);
if (!is_array($data)) {
fwrite(STDERR, "Could not decode JSON; HTTP status: " . $status . PHP_EOL);
exit;
}

if (($data['success'] ?? false) !== true) {
$message = $data['error'] ?? 'No error message was supplied.';
fwrite(STDERR, "API request failed: " . $message . PHP_EOL);
exit;
}

$rate = $data['rates'][$symbol] ?? null;
$date = $data['dates'][$symbol] ?? null;
$currency = $data['currencies'][$symbol] ?? null;
$base = $data['base'] ?? null;

if ($rate === null) {
fwrite(STDERR, "No CARBON_INT_IT rate was returned." . PHP_EOL);
exit;
}

echo "Symbol: " . $symbol . PHP_EOL;
echo "Carbon intensity: " . $rate . " gCO2/kWh" . PHP_EOL;
echo "Observation date: " . ($date ?? 'not supplied') . PHP_EOL;
echo "Currency field: " . ($currency ?? 'not supplied') . PHP_EOL;
echo "Base: " . ($base ?? 'not supplied') . PHP_EOL;

The script checks the transport result, JSON decoding, and the API’s success field before accessing the observation. It then checks the requested rate separately. That distinction matters: a successful envelope should not cause your application to display a value for Italy unless the Italy key is actually present.

The unit comes from the symbol’s catalog facts, not from the currencies field. Retain the currency field if it is returned, but do not label gCO2/kWh as a currency or assume that a top-level base changes the meaning of the intensity unit.

Python alternative

If another service in your stack uses Python, the standard library can make the same request. This example also reads an HTTP error response body when one is available, so that an API error envelope can still be inspected.

import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.parse import urlencode
from urllib.request import urlopen

api_key = os.environ.get("ENERGY_API_KEY", "YOUR_API_KEY")
symbol = "CARBON_INT_IT"

query = urlencode(dict(symbols=symbol, api_key=api_key))
url = "https://energy-api.com/api/v1/latest?" + query

try:
with urlopen(url) as response:
body = response.read()
except HTTPError as exc:
body = exc.read()
except URLError as exc:
sys.exit("Request failed: " + str(exc.reason))

try:
data = json.loads(body)
except (ValueError, UnicodeDecodeError):
sys.exit("Could not decode the response as JSON.")

if not isinstance(data, dict):
sys.exit("The response was not a JSON object.")

if data.get("success") is not True:
sys.exit("API request failed: " + str(data.get("error", "No error message was supplied.")))

rate = data.get("rates", dict()).get(symbol)
date = data.get("dates", dict()).get(symbol)
currency = data.get("currencies", dict()).get(symbol)
base = data.get("base")

if rate is None:
sys.exit("No CARBON_INT_IT rate was returned.")

print("Symbol:", symbol)
print("Carbon intensity:", rate, "gCO2/kWh")
print("Observation date:", date if date is not None else "not supplied")
print("Currency field:", currency if currency is not None else "not supplied")
print("Base:", base if base is not None else "not supplied")

As with the PHP version, the unavailable-symbol error stops processing before any rate is displayed. In an application, you can replace the command-line error with a structured failure result, while keeping the error distinct from a valid numeric observation.

Operational details for a reliable integration

Dates and timezones. Preserve dates.CARBON_INT_IT alongside the value when it is returned. The supplied information does not establish a timestamp or timezone for this symbol, so do not convert the date into an assumed local or UTC timestamp. A top-level date, if present, should not replace the symbol-specific date without verifying its meaning.

Base and mixed responses. The response base may be MIXED. Store it as returned rather than assuming every result shares one currency. If a request also needs TTF_GAS or EUA_CO2, do not pass base=USD; the Italy-only examples above do not pass a base parameter.

Caching and freshness. Cache a successful observation together with its symbol, unit, and returned date, rather than caching only a number. Choose a refresh policy appropriate for your application and call allowance. The supplied response does not establish an update frequency or a non-trading-day schedule, so a cached result should not be presented as freshly updated solely because it came from the latest endpoint.

Unavailable data. Keep the most recent successful observation separate from the current request status. If a later request reports that the symbol is unavailable, an application may display its previously stored observation with its original date and an availability warning; it should not silently present that observation as the result of the failed request.

Credentials. Because the key is a query parameter, take care when recording request URLs in logs or diagnostics. Redact the key before sharing troubleshooting output. The Starter plan is $19.99 per month, and the trial provides 7 days and 50 calls, so development requests should be deliberate.

FAQ

Is CARBON_INT_IT an electricity spot price?

No. It is Italy Carbon Intensity, measured in gCO2/kWh. Treat its result as an intensity observation, not as a price per unit of electricity.

Why does the request return a symbol-availability error?

The supplied live call reported that CARBON_INT_IT was not currently available. Check the current catalog indicated by the error and handle the failure until the symbol is available; the supplied response contains no Italy tick.

Which date should I attach to the Italy value?

Use dates.CARBON_INT_IT when it is returned with the observation. Preserve it as supplied, and do not infer a timezone or timestamp from a date-only value.

Can I assume that base is EUR?

No. The separate official example shows EUR, but it is for a different symbol, and base may be MIXED. Read the actual response and keep the carbon-intensity unit separate from currency metadata.

Register to obtain an API key, then run the request and check the current availability of CARBON_INT_IT before connecting the result to your application.

Ready to get started?

Get your API key and start querying energy commodity prices in minutes.

Get API Key