France Carbon Intensity Price API
You need to read the latest France grid carbon intensity as a live, machine-readable number you can alert on, cache, and display in your energy app. By the end of this guide, you’ll know exactly how to call the Energy API for the France Carbon Intensity symbol, parse the fields you need, handle unavailable data, and ship a production-grade integration.
What the France Carbon Intensity symbol provides
This guide focuses on a single Energy category symbol and how to fetch it via the latest-price endpoint. You will pull a point-in-time carbon intensity for France, in grams of CO2 per kWh, and read it from the standard response structure.
- Symbol name: France Carbon Intensity
- Symbol code: CARBON_INT_FR
- Unit: gCO2/kWh
- Endpoint: GET https://energy-api.com/api/v1/latest
- Authentication: api_key as a query parameter
- Fields to read: rates.CARBON_INT_FR, dates.CARBON_INT_FR, currencies.CARBON_INT_FR
- Base: may be MIXED depending on the symbol set you query
Pricing and access: Starter is $19.99/mo with a 7-day trial limited to 50 calls. There is no MCP host requirement.
Endpoint and authentication
Use a GET request to the latest endpoint with the symbols list and your api_key as query parameters. Supply the France Carbon Intensity code exactly as shown below, and do not add unrelated base parameters.
- URL: https://energy-api.com/api/v1/latest
- Query params:
- symbols=CARBON_INT_FR
- api_key=YOUR_API_KEY
Important base note: Do not pass base=USD when you also need TTF_GAS or EUA_CO2; those operate on a mixed base. For this single-symbol request, omit base entirely.
Quickstart: cURL request you can paste
Use the official cURL form with query parameters encoded. Replace YOUR_API_KEY with your actual key.
curl -G "https://energy-api.com/api/v1/latest" --data-urlencode "symbols=CARBON_INT_FR" --data-urlencode "api_key=YOUR_API_KEY"
Official sample response format (success)
The following official sample demonstrates the envelope and key structure this endpoint returns on success. Your integration logic should mirror how you read fields across this schema.
{
"success": true,
"date": "2026-10-09",
"base": "EUR",
"rates": {
"OMIE_ES_DA": 108.8393
},
"dates": {
"OMIE_ES_DA": "2026-10-09"
},
"currencies": {
"OMIE_ES_DA": "EUR"
},
"base_filter_note": null
}
What matters for parsing:
- success: boolean; check this before reading any series values.
- date: the envelope date for the snapshot.
- base: the base context for listed series (can be MIXED for certain symbol sets).
- rates: a dictionary keyed by symbol code to its latest numeric value.
- dates: a dictionary keyed by symbol code to the date timestamp of that value.
- currencies: for monetary series this holds the currency; for non-monetary units, treat as the unit context returned by the API.
- base_filter_note: optional note on base filtering (may be null).
Real-world response: handling unavailable data
If a live call cannot return data for a symbol, you will receive an error envelope. Your code should branch on success=false and handle this deterministically (retry, fallback cache, or user-facing note).
{"success":false,"error":"No rate data available for the requested symbols."}
When you see success=false:
- Do not attempt to read rates.*, dates.*, or currencies.*.
- Surface a clear message or backfill from your last known good cache entry.
- Adjust your polling cadence if appropriate (e.g., exponential backoff).
Python example: fetch and parse France Carbon Intensity
This Python snippet calls the same endpoint shown above, checks the envelope, and extracts the numeric value, timestamp, and unit context for CARBON_INT_FR when available.
import os
import sys
import time
import urllib.parse
import json
from typing import Optional
import http.client
API_HOST = "energy-api.com"
API_PATH = "/api/v1/latest"
def build_query(symbols: str, api_key: str) -> str:
params = {
"symbols": symbols,
"api_key": api_key
}
return urllib.parse.urlencode(params, doseq=True)
def fetch_latest(symbols: str, api_key: str) -> dict:
conn = http.client.HTTPSConnection(API_HOST, timeout=15)
path = f"{API_PATH}?{build_query(symbols, api_key)}"
conn.request("GET", path)
resp = conn.getresponse()
body = resp.read().decode("utf-8")
conn.close()
try:
return json.loads(body)
except json.JSONDecodeError:
raise RuntimeError(f"Non-JSON response (status {resp.status}): {body}")
def get_fr_carbon_intensity(api_key: str) -> Optional[dict]:
data = fetch_latest("CARBON_INT_FR", api_key)
if not data.get("success"):
# Handle unavailable data deterministically
# For production: log and return None so caller can use cached value
sys.stderr.write(f"Energy API error: {data.get('error')}\n")
return None
# Required fields
rates = data.get("rates", {})
dates = data.get("dates", {})
currencies = data.get("currencies", {})
# Read the exact keys documented for this symbol
value = rates.get("CARBON_INT_FR")
ts = dates.get("CARBON_INT_FR")
unit_or_currency = currencies.get("CARBON_INT_FR")
if value is None or ts is None:
# Defensive: unexpected shape; return None for caller handling
return None
# Note: For France Carbon Intensity, value is in gCO2/kWh
# Unit is represented via the currencies/units map for consistency
return {
"value_gco2_per_kwh": value,
"timestamp": ts,
"unit_context": unit_or_currency,
"base": data.get("base")
}
if __name__ == "__main__":
api_key = os.environ.get("ENERGY_API_KEY", "YOUR_API_KEY")
result = get_fr_carbon_intensity(api_key)
if result is None:
print("No current France Carbon Intensity available; using fallback.")
sys.exit(0)
print(json.dumps(result, indent=2))
Notes:
- This uses a low-level HTTPS client to reduce external dependencies. Any HTTP library is fine.
- Always branch on success. Never assume rates.* keys exist.
- CARBON_INT_FR values are gCO2/kWh. Cache them with timestamps.
JSON examples and field annotations you will use
Use these examples to test your parsing and error-path logic. Keep your code field-driven (rates.* / dates.* / currencies.*) so it continues to work across Energy symbols.
Example A: Official success envelope
{
"success": true,
"date": "2026-10-09",
"base": "EUR",
"rates": {
"OMIE_ES_DA": 108.8393
},
"dates": {
"OMIE_ES_DA": "2026-10-09"
},
"currencies": {
"OMIE_ES_DA": "EUR"
},
"base_filter_note": null
}
How to adapt for CARBON_INT_FR parsing:
- Check success == true.
- Read rates.CARBON_INT_FR (numeric), dates.CARBON_INT_FR (timestamp), currencies.CARBON_INT_FR (unit context). These keys share the same structure as shown.
Example B: Real error when data is currently unavailable
{"success":false,"error":"No rate data available for the requested symbols."}
Application behavior suggestions:
- Return HTTP 503 or similar from your backend and serve a last-known-good value to clients.
- Log the error string for observability and retry with backoff.
Example C: Error envelope repeated for resilience testing
{"success":false,"error":"No rate data available for the requested symbols."}
Use this identical envelope to simulate transient outages across multiple polling cycles in your tests.
How to decide polling, caching, and time semantics
While the latest endpoint returns a snapshot, the availability cadence can vary by symbol. Build your client with predictable polling and caching rules to avoid unnecessary errors or rate waste.
- Polling interval: Start at 1–5 minutes for operational dashboards. Increase the interval if you frequently see success=false.
- Caching: Store a last-known-good for CARBON_INT_FR with its dates.CARBON_INT_FR timestamp. When the API returns success=false, continue to display the cached value with a stale indicator.
- Timestamps: Use the per-series timestamp in dates.CARBON_INT_FR, not only the envelope date, for precision.
- Units: Treat CARBON_INT_FR as gCO2/kWh. Do not perform currency conversions.
- Base: The base field may be MIXED when you mix certain symbols. For a single-symbol call to CARBON_INT_FR, you should omit base in the request and simply read the base from the response.
Handling multiple symbols without breaking CARBON_INT_FR
If your application later expands to fetch additional Energy symbols, keep CARBON_INT_FR in the same request by comma-separating symbols. Make sure you do not add base=USD when you also include TTF_GAS or EUA_CO2; those may require a mixed base context. Read each symbol’s value independently from the rates, dates, and currencies maps by its exact code.
Operational concerns: quotas, errors, and observability
The Starter plan is $19.99/month with a 7-day trial allowing 50 calls. Track your polling schedule and the number of distinct environments that call the API to stay under trial limits while you build.
- 429s and quota: If your client implements retries, use exponential backoff and jitter. Cache aggressively to reduce repeat calls.
- Transport errors: On network failures or non-JSON bodies, treat the response as a temporary outage and fail closed with cached data.
- Validation: Validate that rates.CARBON_INT_FR is numeric and within a plausible range for your application before storing.
JavaScript example: browser-safe proxy pattern
Call the Energy API from your backend to keep YOUR_API_KEY secret. This Node.js-style fetch snippet demonstrates the same parsing logic server-side.
import http from "node:http";
import https from "node:https";
function query(params) {
return new URLSearchParams(params).toString();
}
async function fetchLatest(symbols, apiKey) {
const url = `https://energy-api.com/api/v1/latest?${query({
symbols,
api_key: apiKey
})}`;
const res = await fetch(url, {
method: "GET",
agent: (url.startsWith("https") ? new https.Agent({ keepAlive: true }) : new http.Agent({ keepAlive: true }))
});
const data = await res.json();
return data;
}
export async function getFranceCarbonIntensity(apiKey) {
const data = await fetchLatest("CARBON_INT_FR", apiKey);
if (!data.success) {
// Do not attempt to parse series maps when success=false
return { ok: false, error: data.error || "Unknown error" };
}
const value = data.rates?.CARBON_INT_FR;
const ts = data.dates?.CARBON_INT_FR;
const unit = data.currencies?.CARBON_INT_FR;
if (value == null || ts == null) {
return { ok: false, error: "Missing CARBON_INT_FR fields" };
}
return {
ok: true,
value_gco2_per_kwh: value,
timestamp: ts,
unit_context: unit,
base: data.base
};
}
Security tip: Keep keys server-side and expose only your normalized CARBON_INT_FR payload to clients.
Troubleshooting checklist specific to CARBON_INT_FR
- Symbol spelling: Must be exactly CARBON_INT_FR. Any deviation will result in success=false.
- Auth parameter: Use api_key as a query parameter named api_key. Don’t place it in headers for this endpoint.
- Unavailable data: Expect the error envelope and code your cache/fallback path.
- Units: The value represents gCO2/kWh. Do not attempt currency conversions or add base=USD.
- Mixed symbol sets: If you later include TTF_GAS or EUA_CO2 in the same call, do not pass base=USD; read the returned base field (may be MIXED).
End-to-end test procedure
Use the steps below to finalize your integration and confirm correctness under common conditions.
- Success-path parse:
- Call the endpoint with symbols=CARBON_INT_FR and a valid key.
- Assert data.success === true.
- Assert typeof rates.CARBON_INT_FR === "number" and dates.CARBON_INT_FR is a valid timestamp string.
- Store value and timestamp with unit context.
- Error-path parse:
- Simulate an outage and feed your service the error envelope below.
- Assert your code does not access rates/dates/currencies when success=false.
- Verify you return last-known-good to clients and schedule a retry.
- Cache validation:
- Write-through cache on success; read-through cache on error.
- Mark stale values with their dates.CARBON_INT_FR timestamp.
Replay the error envelope for automated tests
Use the real-world error JSON as-is for deterministic contract testing:
{"success":false,"error":"No rate data available for the requested symbols."}
Include assertions that your parser returns a typed error object, not null or partial data structures, when this envelope is seen.
Plan selection and trial workflow
Start on the trial (7 days / 50 calls) to wire up your polling, caching, and alerting. Move to Starter at $19.99/mo once you confirm your deployment cadence and dashboards are stable. Keep your polling interval modest to preserve headroom for manual checks and CI tests.
Links you’ll need once you’re ready
FAQ
What symbol code do I use for France grid carbon intensity?
Use CARBON_INT_FR exactly as shown. Read its value from rates.CARBON_INT_FR and its timestamp from dates.CARBON_INT_FR.
What are the units for CARBON_INT_FR?
gCO2/kWh. Treat the numeric value as grams of CO2 emitted per kilowatt-hour.
Should I pass a base parameter?
No. Omit base for this single-symbol call. If you later include symbols such as TTF_GAS or EUA_CO2, do not pass base=USD; read the base returned by the API, which may be MIXED.
How do I authenticate?
Provide your key via the api_key query parameter. For example: api_key=YOUR_API_KEY.
What if the API returns no data?
You’ll receive success=false with an error string. Do not parse series fields; fall back to your last-known-good cache and retry with backoff.
Next step
Create your key and run the cURL above against CARBON_INT_FR. Wire the Python or JavaScript sample into your service, add a simple cache for the last-known-good value, and cover the error envelope in tests. When you’re ready, move past the trial by signing up on Register, and keep the endpoint reference handy in the Documentation.
Ready to get started?
Get your API key and start querying energy commodity prices in minutes.
Get API KeyRelated posts
Unlock the power of Energy API for accurate hourly Scope 2 emissions reporting. Discover how to streamline cor...
Read more →
Discover how the Energy API streamlines the reconciliation of green hydrogen guarantees, enhancing ESG reporti...
Read more →
Discover how Energy API enables provenance-first carbon accounting to accurately trace Scope 2 and Scope 3 emi...
Read more →
Discover how to optimize your EV fleet charging with an Energy API. Learn dynamic tariff selection and vehicle...
Read more →
Discover how Energy API enables real-time monitoring and orchestration of DERs to relieve distribution grid co...
Read more →
Discover how to build a geo-fenced distributed energy resource orchestrator using Energy API and MQTT for low-...
Read more →