Public net electricity generation by source (wind, solar, gas, coal, nuclear, hydro, biomass...), load, residual load, cross-border trading and renewable share for a European country, hourly or at the source resolution, up to 7 days, with averages and peaks per source (MW), plus summary: average load, residual load and cross-border trading (MW) and average renewable share of generation and of load (percent) over the period.
Every response includes credits_used: the credits this call cost.
Parameters
name
type
description
country
de | ch | eu | all | al | am | at | az | ba | be | bg | by | cy | cz | dk | ee | es | fi | fr | ge | gr | hr | hu | ie | it | lt | lu | lv | md | me | mk | mt | nie | nl | no | pl | pt | ro | rs | ru | se | si | sk | tr | ua | uk | xk
Country code (lower case), e.g. de, fr, es, it, nl, pl, uk, eu. Example: de
date
string
One day (YYYY-MM-DD, default today). Example: 2026-10-01
start_date
string
Range start.
end_date
string
Range end (max 7 days).
resolution
hour | raw
hour (default) or raw (15 minutes where available).
import os, requests
res = requests.get(
"https://api.api.sh/energy/v1/generation",
params={"country": "de"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json()
const url = new URL("https://api.api.sh/energy/v1/generation");
url.searchParams.set("country", "de");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json();
Response
A JSON object with the fields described above, plus raw (the source's own data), cached, fetched_at and credits_used. Errors return {"success": false, "error": "…"} with the HTTP status (see errors). A lookup that ran but found nothing (404) costs the price above; refused calls and errors on our side are free (what's charged).
The fastest way to see the full response is the playground: it runs this endpoint with your account and shows the exact JSON.