Country Energy Statistics API
Long annual energy series by country and year: population, GDP, primary energy and electricity generation, shares of electricity from renewables, solar, wind, coal, gas and nuclear, carbon intensity and energy per person.
$0.50 per 1,000 records
You pay only for the records you get. Zero records cost zero. 10,000 free records of this API to start (5,000 at the base price of $1 per 1,000), no card.
Data from github.com/owid/energy-data
Get this data
Try it here with a few records, download the sample, fill a Google Sheet, or call it from your own code.
Try it
Run it on this page, or call it from your code with the endpoint in the developer section. A free key covers 10,000 records of this API, no card. Create a free key
For developers: the API and MCPThe endpoint, code in curl, JavaScript and Python, every input, and files for your tools
- Small runs answer in the same request; longer ones answer
202with a run to poll. fieldsreturns only the fields you name. The examples send the ones picked on this page.Idempotency-Keyis optional. A retry with it is never charged twice.- You pay for records returned. Zero records cost zero.
curl -X POST "https://pullrow.dev/v1/apis/country-energy-statistics/run" \
-H "Authorization: Bearer $PULLROW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"countries":["Canada","India"]},"max_items":50}'Inputs
Send them as input in the request body. Leave one out to use its default.
What's in each record
15 fields.
Basics
- ISO code
ISO 3166 alpha-3 country code; empty for regions and groups.
Example CAN
- Population
Example 35,962,236
- Gdp
Gross domestic product in international dollars.
Example 1,568,025,782,105
- Primary energy consumption
Primary energy consumption in terawatt-hours.
Example 4,021.453
- Electricity generation
Electricity generation in terawatt-hours.
Example 661.08
- Renewables share elec
Share of electricity from renewables, in percent.
Example 63.841%
- Solar share elec
Share of electricity from solar, in percent.
Example 0.437%
- Wind share elec
Share of electricity from wind, in percent.
Example 4.08%
- Coal share elec
Share of electricity from coal, in percent.
Example 9.826%
- Gas share elec
Share of electricity from gas, in percent.
Example 10.283%
- Nuclear share elec
Share of electricity from nuclear, in percent.
Example 15.293%
- Carbon intensity elec
Grams of CO2 emitted per kilowatt-hour of electricity.
Example 184.37
- Energy per capita
Primary energy use per person in kilowatt-hours.
Example 111,824.336
Location
- Country
Country, region or group name.
Example Canada
Dates
- Calendar year
Example 2015
Technical detailsField names and types for developers
Field names and types
The names your code reads in each record. "Filled" counts how many of the 3 sample records carry the field.
| Field name | Type | Shown on this page as | Filled |
|---|---|---|---|
country | text | Country | 3 of 3 |
year | number | Calendar year | 3 of 3 |
iso_code | text | ISO code | 3 of 3 |
population | number | Population | 3 of 3 |
gdp | number | Gdp | 3 of 3 |
primary_energy_consumption | number | Primary energy consumption | 3 of 3 |
electricity_generation | number | Electricity generation | 3 of 3 |
renewables_share_elec | number | Renewables share elec | 3 of 3 |
solar_share_elec | number | Solar share elec | 3 of 3 |
wind_share_elec | number | Wind share elec | 3 of 3 |
coal_share_elec | number | Coal share elec | 3 of 3 |
gas_share_elec | number | Gas share elec | 3 of 3 |
nuclear_share_elec | number | Nuclear share elec | 3 of 3 |
carbon_intensity_elec | number | Carbon intensity elec | 3 of 3 |
energy_per_capita | number | Energy per capita | 3 of 3 |
How it reads the site
Runs on a reader we built and maintain by hand for this site.
Save as pipeline
A pipeline remembers this API, your inputs and the fields you picked. It can run on a schedule and email you the results.
Sample records
| Record | ISO code | Population | Gdp | Primary energy consumption | Electricity generation | Renewables share elec | Solar share elec | Wind share elec | Coal share elec | Gas share elec | Nuclear share elec | Carbon intensity elec | Energy per capita | Country | Calendar year |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | CAN | 35,962,236 | 1,568,025,782,105 | 4,021.453 | 661.08 | 63.841% | 0.437% | 4.08% | 9.826% | 10.283% | 15.293% | 184.37 | 111,824.336 | Canada | 2015 |
| 2 | CAN | 36,353,345 | 1,583,727,974,022 | 3,973.037 | 667.13 | 64.565% | 0.451% | 4.636% | 9.746% | 9.866% | 15.098% | 180.88 | 109,289.445 | Canada | 2016 |
| 3 | CAN | 36,808,498 | 1,631,871,440,185 | 4,026.635 | 669.35 | 65.819% | 0.495% | 4.708% | 9.384% | 9.182% | 15.03% | 172.06 | 109,394.164 | Canada | 2017 |
Sample records from the example output this API publishes. Email addresses and phone numbers in them are masked. Hover over a column name to see the field name your code reads.
Reliability
Counted from real runs. Our own health checks are left out. A run succeeded when it finished and the site neither blocked it nor broke it.
Incidents and repairs
How it is kept working What a repair can't do
A ready-made API, maintained by us. It is not part of the daily check or the automatic rebuild yet.
- You pay only for records returned. A run that returns none costs nothing.
- One row per country and year, from the 1800s or 1900s (it depends on the country) up to the latest year Our World in Data has published, usually one to two years ago.
- Many values are empty for early years and smaller countries, and the latest year is often incomplete.
- Besides countries the dataset has regions and groups such as World, Europe, Africa and income groups. Name them exactly as the dataset does.
- Country names are matched in English, ignoring capitals. Energy values are in terawatt-hours, shares in percent, carbon intensity in grams of CO2 per kilowatt-hour, energy per capita in kilowatt-hours; GDP is in international dollars.
- A run returns at most 20,000 rows. Our World in Data refreshes the dataset a few times a year, built from the Energy Institute, Ember and other sources.
- Source: Our World in Data energy dataset, licensed CC BY 4.0: credit Our World in Data and its underlying sources when you publish.
Version history
A run uses the live version unless the request names another one with version.
Manage this API
Only your workspace sees this part.
Automatic repair
Off: a rebuilt version is stored and waits for you in the version history.
Delete this API
Removes the API, its versions and the saved records of its runs. Calls to its address then answer 404. Records already charged stay charged. This cannot be undone.