Reference

API reference

Base URL https://api.carbondata.dev. Every endpoint is a GET and returns JSON unless the path ends in another format.

Generated from the dataset contracts when this site was built. Add @{version} after any dataset id to pin a version (how). Errors are problem documents.

Endpoints

GET /v1

The API index for this site.

  • site, name, tagline
  • api_version: "v1"
  • links.catalog, links.status

Example: https://api.carbondata.dev/v1

GET /v1/catalog

Every dataset published on this site.

  • site
  • datasets[]: id, kind, title, description, current (version), published_at, cadence, check_every, sla, discontinued
  • datasets[].source: name, url, license, commercial_ok
  • datasets[].coverage: start, end

Example: https://api.carbondata.dev/v1/catalog

GET /v1/status

How fresh each dataset is.

  • site, generated_at, overall ("ok" or "degraded")
  • datasets[]: id, status, version, checked_at, source_updated_at, sla, consecutive_failures, last_error
  • status is one of ok, pending, late, stale-upstream, failing, blocked, discontinued

Example: https://api.carbondata.dev/v1/status

GET /v1/{dataset}

Metadata for one dataset: the version that answered, its coverage, source, validation and downloads.

  • dataset, kind, title, description, cadence
  • version, current_version, pinned, published_at
  • source: id, name, publisher, url, license, commercial_ok, attribution, retrieved_at, source_updated_at
  • coverage: start, end
  • validation: status (pass, warn), warnings[]
  • series[]: id, name; for tables also key[] and partition
  • downloads[]: name, bytes, url
  • links: locations, versions, this_version

Example: https://api.carbondata.dev/v1/emission-factors

Errors: unknown-dataset , unknown-version , data-unavailable , and rate-limited for any endpoint.

GET /v1/{dataset}/versions

The version history.

  • dataset, current, published_at
  • previous[]: earlier version ids, newest first
  • snapshots: month (YYYY-MM) to version id

Example: https://api.carbondata.dev/v1/emission-factors/versions

Errors: unknown-dataset , and rate-limited for any endpoint.

GET /v1/{dataset}/locations

What can be requested: each series with its location ids, or for tables the partitions (under the series id "table").

  • dataset, version, kind
  • series[]: id, name, locations[] (ids)
  • locations[]: id, name

Example: https://api.carbondata.dev/v1/emission-factors/locations

Errors: unknown-dataset , unknown-version , and rate-limited for any endpoint.

GET /v1/{dataset}/{series}/{location}.json

One series at one place, ordered by date. Also .csv.

  • meta: dataset, series, series_name, location, location_name, units, source, license, attribution
  • data[]: one object per row, with the dataset's columns

Example: https://api.carbondata.dev/v1/national-fossil-co2/total/gcb-international-aviation.json

Errors: unknown-file , unknown-format , and rate-limited for any endpoint.

GET /v1/{dataset}/table/{partition}.json

Rows of a table for one partition value; table/all has every row for tables up to 50,000 rows. Also .csv.

  • meta: dataset, key, partition (when partitioned), rows (count), units, source, license, attribution
  • rows[]: one object per row

Example: https://api.carbondata.dev/v1/emission-factors/table/all.json

Errors: unknown-file , unknown-format , and rate-limited for any endpoint.

GET /v1/{dataset}/download/{dataset}.csv

The whole dataset in one file. Also .parquet. Series downloads add series and location columns.

  • CSV (text/csv) or Parquet (application/vnd.apache.parquet)
  • Supports Range requests (206)

Example: https://api.carbondata.dev/v1/emission-factors/download/emission-factors.csv

Errors: unknown-file , and rate-limited for any endpoint.

GET /v1/{dataset}/{path}

A file of a files dataset, at its published path.

  • The file, with a content type from its extension

Errors: unknown-file , and rate-limited for any endpoint.

Datasets

Emission factors Table

Id
emission-factors
Updates
Monthly
Key
factor_id
Partition
source
Columns
factor_id text , source text , source_version text , source_ref text , scope text , category text , activity text , region text , region_type text , activity_unit text , gas text , value number , unit text , gwp_set text , valid_year year (YYYY) , notes text
What Path
Metadata: version, coverage, downloads, validation /v1/emission-factors
Versions and monthly snapshots /v1/emission-factors/versions
Partitions /v1/emission-factors/locations
Rows for one source (JSON) /v1/emission-factors/table/{source}.json
Rows for one source (CSV) /v1/emission-factors/table/{source}.csv
All rows in one file (tables up to 50,000 rows) /v1/emission-factors/table/all.json
Whole dataset (CSV) /v1/emission-factors/download/emission-factors.csv
Whole dataset (Parquet) /v1/emission-factors/download/emission-factors.parquet

National fossil CO2 emissions Time series

Id
national-fossil-co2
Updates
Yearly
Series
total, coal, oil, gas, cement, flaring, other
Columns
date year (YYYY) , value number, MtCO2
What Path
Metadata: version, coverage, downloads, validation /v1/national-fossil-co2
Versions and monthly snapshots /v1/national-fossil-co2/versions
Series and locations /v1/national-fossil-co2/locations
Total fossil CO2 emissions (JSON) /v1/national-fossil-co2/total/{location}.json
Total fossil CO2 emissions (CSV) /v1/national-fossil-co2/total/{location}.csv
Fossil CO2 emissions from coal (JSON) /v1/national-fossil-co2/coal/{location}.json
Fossil CO2 emissions from coal (CSV) /v1/national-fossil-co2/coal/{location}.csv
Fossil CO2 emissions from oil (JSON) /v1/national-fossil-co2/oil/{location}.json
Fossil CO2 emissions from oil (CSV) /v1/national-fossil-co2/oil/{location}.csv
Fossil CO2 emissions from gas (JSON) /v1/national-fossil-co2/gas/{location}.json
Fossil CO2 emissions from gas (CSV) /v1/national-fossil-co2/gas/{location}.csv
Fossil CO2 emissions from cement (process emissions) (JSON) /v1/national-fossil-co2/cement/{location}.json
Fossil CO2 emissions from cement (process emissions) (CSV) /v1/national-fossil-co2/cement/{location}.csv
Fossil CO2 emissions from flaring (includes vented methane) (JSON) /v1/national-fossil-co2/flaring/{location}.json
Fossil CO2 emissions from flaring (includes vented methane) (CSV) /v1/national-fossil-co2/flaring/{location}.csv
Fossil CO2 emissions from other carbonates (JSON) /v1/national-fossil-co2/other/{location}.json
Fossil CO2 emissions from other carbonates (CSV) /v1/national-fossil-co2/other/{location}.csv
Whole dataset (CSV) /v1/national-fossil-co2/download/national-fossil-co2.csv
Whole dataset (Parquet) /v1/national-fossil-co2/download/national-fossil-co2.parquet