API to Get the France Carbon Intensity Price

API to Get the France Carbon Intensity Price

You need programmatic access to France’s grid carbon intensity so your app can display or act on real-time gCO2/kWh data. By the end of this guide, you’ll know how to call the Energy API for the France Carbon Intensity symbol, interpret the response fields, handle temporary symbol unavailability, and ship a minimal integration.

What you get: France Carbon Intensity (CARBON_INT_FR)

This guide focuses on a single Energy API symbol:

Illustration: API to Get the France Carbon Intensity Price
  • Symbol name: France Carbon Intensity
  • Symbol code: CARBON_INT_FR
  • Unit: gCO2/kWh

Authentication is via an api_key query parameter. Use YOUR_API_KEY in examples. Plans start at Starter $19.99/mo and include a trial (7 days / 50 calls). The field mapping to read after a successful call is:

  • rates.CARBON_INT_FR — the latest intensity value in gCO2/kWh
  • dates.CARBON_INT_FR — the date of that value
  • currencies.CARBON_INT_FR — present for schema consistency; not meaningful for intensity

The base may be MIXED depending on the symbol set you query. When working with fuel-price symbols like TTF_GAS or EUA_CO2 alongside others, do not pass base=USD in the same request. For CARBON_INT_FR alone, a base override is not required.

Endpoint and auth parameters

Use the latest endpoint to fetch live data for one or more symbols:

  • Method: GET
  • Path: /api/v1/latest
  • Required params:
    • symbols — comma-separated list, e.g., CARBON_INT_FR
    • api_key — your API key sent as a query parameter

The response includes a top-level date, base, and per-symbol fields in rates, dates, and currencies. For CARBON_INT_FR, use the value in gCO2/kWh. The API may return base as MIXED when the request includes heterogeneous symbols; your code should not assume a single monetary base for non-price metrics like intensities.

For complete parameter details and catalog availability, review the Documentation.

Quickstart with cURL

This is the minimal, copy-pasteable request to query the France Carbon Intensity symbol via GET /api/v1/latest, authenticating with api_key in the query string:

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

If successful and available, you will read rates.CARBON_INT_FR for the numeric gCO2/kWh value and dates.CARBON_INT_FR for the date stamp. If the symbol is temporarily out of catalog, you’ll receive a structured error; see the “Availability and error handling” section below.

Python example: request and field extraction

This short Python snippet performs the same GET call and demonstrates how to read the fields you need. It’s designed to be robust to MIXED base and to handle the per-symbol maps consistently.

import requests
from urllib.parse import urlencode

API_URL = "https://energy-api.com/api/v1/latest"
params = {
"symbols": "CARBON_INT_FR",
"api_key": "YOUR_API_KEY",
}

resp = requests.get(API_URL, params=params, timeout=15)
resp.raise_for_status()
data = resp.json()

if not data.get("success", True):
# Symbol might be temporarily unavailable; log and branch to fallback
raise RuntimeError(f"Energy API error: {data.get('error')}")

rates = data.get("rates", {})
dates = data.get("dates", {})
currencies = data.get("currencies", {})

value = rates.get("CARBON_INT_FR")
value_date = dates.get("CARBON_INT_FR")
unit = "gCO2/kWh" # From catalog facts for CARBON_INT_FR
symbol_currency = currencies.get("CARBON_INT_FR") # Often present for consistency

if value is None:
raise ValueError("CARBON_INT_FR missing in rates map")

print(f"France carbon intensity: {value} {unit} (as of {value_date})")
# Note: data.get("base") may be MIXED. Do not use it to transform CARBON_INT_FR.

Production tip: handle API timeouts and network errors with retries and small backoff. Cache the last good intensity value for a short window to avoid UI gaps if the symbol is briefly unavailable or rate-limited.

Understanding the response schema

The Energy API returns a consistent envelope across symbols: a top-level success flag, a date, a base, and per-symbol maps in rates, dates, and currencies. Below is an official sample response you can use to validate schema and parsing logic. Note that this sample uses a different symbol (OMIE_ES_DA) purely to illustrate the structure and fields; apply the same shape to CARBON_INT_FR in your code.

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

Field notes for your CARBON_INT_FR integration:

  • success — check this before reading any symbol fields.
  • date — the response-wide date stamp; use dates.CARBON_INT_FR for per-symbol precision when you query multiple symbols.
  • base — may be MIXED when mixing categories; do not use for non-monetary metrics like gCO2/kWh.
  • rates.CARBON_INT_FR — the value to display or feed to your model, in gCO2/kWh.
  • dates.CARBON_INT_FR — the date of that CARBON_INT_FR value.
  • currencies.CARBON_INT_FR — included for schema parity; typically not used for intensity.

Availability and error handling for CARBON_INT_FR

Symbols can rotate in and out of the live catalog. When a symbol isn’t currently available, the API returns a descriptive error envelope. Here is the exact live error payload for CARBON_INT_FR at the time this guide was prepared. Use it to implement your error handling and user messaging.

{"success":false,"error":"Symbol CARBON_INT_FR is not currently available. See \/api\/v1\/symbols for the current catalog."}

When you encounter this envelope:

  • Do not retry in a tight loop. Backoff or fall back to a cached last-known value if appropriate for your UX.
  • Consider querying the catalog endpoint mentioned in the error message to discover alternatives or confirm availability windows.
  • Log the event and surface a clear UI state (e.g., “Live intensity temporarily unavailable”).

To help with robust parsing and tests, here is the official schema sample again for validation against your deserializer and contracts. Although it references OMIE_ES_DA, the same structure applies to CARBON_INT_FR when it becomes available again:

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

Operational guidance: units, time semantics, caching, and mixed bases

Units and conversions

CARBON_INT_FR is measured in gCO2/kWh. Do not attempt currency conversions on this symbol. If you query price symbols concurrently (e.g., energy prices) that do use currencies, remember that base may be MIXED, and a single cross-rate transform will not apply uniformly. Keep intensity handling separate from price normalization logic.

Timestamps and per-symbol dates

Use dates.CARBON_INT_FR for the precise data-stamp of the intensity value. The top-level date is helpful for snapshot metadata, but when requesting multiple symbols, prefer the per-symbol dates map for correctness.

Caching and refresh cadence

  • Short-term cache: Cache successful responses for a small TTL to reduce load and smooth over transient network hiccups.
  • Graceful degradation: If the symbol becomes temporarily unavailable, serve the last cached value with a “stale” indicator until it refreshes or you remove it from display.
  • Backoff: On API or network errors, use exponential backoff and jitter rather than fixed-interval retries.

Multiple symbols in one call

If you add more symbols in the same call, keep track that rates, dates, and currencies are per-symbol maps. Never assume the presence of a unified currency in base when the set includes non-price metrics or heterogeneous regions. As noted in the catalog facts, do not pass base=USD when you also need TTF_GAS or EUA_CO2 in that same request.

Troubleshooting common issues

  • HTTP 200 with success=false: The API uses a success flag in the JSON; always inspect it before accessing rates. For CARBON_INT_FR, you may currently see an unavailability error. Example:
{"success":false,"error":"Symbol CARBON_INT_FR is not currently available. See \/api\/v1\/symbols for the current catalog."}
  • Missing field in rates: If rates.CARBON_INT_FR is None or missing, treat this as a data gap. Check missing_symbols if present, and surface a UI-safe fallback.
  • Mixed base confusion: If base is MIXED, that is expected when mixing symbol categories. Do not coerce CARBON_INT_FR into any currency-based pipeline.
  • Access denied or key issues: Confirm the api_key query parameter is present and valid. Verify your plan (Starter $19.99/mo; trial 7 days / 50 calls) has remaining quota.

FAQ

What endpoint and parameters do I use to fetch France carbon intensity?
Use GET /api/v1/latest with symbols=CARBON_INT_FR and api_key=YOUR_API_KEY in the query string.

Which fields from the response should I read?
Read rates.CARBON_INT_FR for the numeric intensity (gCO2/kWh) and dates.CARBON_INT_FR for its date. currencies.CARBON_INT_FR is present for schema parity.

Why is base sometimes MIXED, and does it affect CARBON_INT_FR?
When you query heterogeneous symbols, the API may set base to MIXED. This does not affect CARBON_INT_FR, which is not a currency. Treat it as a standalone unit value.

What if CARBON_INT_FR is unavailable in the catalog?
You will receive a structured error with success=false. Backoff retries, consult the catalog endpoint indicated in the error, and optionally serve a cached last-known value.

Can I request CARBON_INT_FR with other symbols in the same call?
Yes. Keep parsing by per-symbol maps (rates, dates, currencies). If you also include price symbols like TTF_GAS or EUA_CO2, do not pass base=USD in that combined request.

Ready to implement this in your app? Create an account to get your API key and start your 7-day trial (50 calls) here: Register. For deeper parameter and catalog details, see the Documentation.

Ready to get started?

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

Get API Key