Time series · world-capitals
World capitals climate
Monthly air temperature at the capital of each country from NASA POWER (MERRA-2 reanalysis, 1981 to present), each with a 1991-2020 normal, the anomaly from that normal and its rank among all years for that calendar month, computed by climatedata.dev.
- Updates
- Monthly
- Coverage
- —
- Current version
- —
- Last published
- —
- Validation
- —
- License
- US Government work
- Commercial use
- Allowed
Chart
Use the API
Each series and location is its own small file. The examples follow the series and location picked above. See the docs for versions, caching and errors.
curl
# One series for one place (.json or .csv)
curl -s "https://api.climatedata.dev/v1/world-capitals/tavg/usa.json"
# Every series and place in one file
curl -sO "https://api.climatedata.dev/v1/world-capitals/download/world-capitals.csv" Python (polars)
import polars as pl
# One series for one place
df = pl.read_csv("https://api.climatedata.dev/v1/world-capitals/tavg/usa.csv")
# Every series and place, with series and location columns
everything = pl.read_parquet("https://api.climatedata.dev/v1/world-capitals/download/world-capitals.parquet") JavaScript
const res = await fetch("https://api.climatedata.dev/v1/world-capitals/tavg/usa.json");
if (!res.ok) throw new Error((await res.json()).detail); // errors are problem+json
const { meta, data } = await res.json();
console.log(meta.location_name, data.at(-1)); // { date, value, ... } Downloads
The whole dataset in one file, with series and location columns. Parquet keeps the column types and is much smaller.
- world-capitals.csv CSV
- world-capitals.parquet Parquet
Schema and series
Each series file has these columns. The bulk downloads add series and location columns in
front.
| Column | Type | Unit | Can be empty | Description |
|---|---|---|---|---|
| date | month (YYYY-MM) | — | no | — |
| value | number | degC | yes | POWER T2M (2 m air temperature) for the MERRA-2 grid cell containing the capital |
| normal | number | degC | yes | Mean of the 1991-2020 values for this capital and calendar month (needs at least 24 of the 30 years) |
| anomaly | number | degC | yes | value minus normal |
| rank | integer | — | yes | Rank of value among all years since 1981 for this capital, series and calendar month: 1 is the warmest; tied years share the smallest rank number |
| capital | text | — | no | Capital city (Natural Earth NAME) |
| latitude | number | degrees_north | no | Point sent to POWER (Natural Earth geometry) |
| longitude | number | degrees_east | no | Point sent to POWER (Natural Earth geometry) |
Series
| Series id | Name |
|---|---|
| tavg | Air temperature at 2 m, monthly mean (°C) |
Locations
Covers all 249 countries (ids: ISO 3166-1 alpha-3, lowercase (usa, twn)).
Place names come from the shared location registry; see Sources.
Source and license
- Source
- NASA Langley Research Center POWER Project, Monthly and Annual API; capitals from Natural Earth
- Publisher
- NASA Langley Research Center
- License
- US Government work (public domain in the United States) (
LicenseRef-US-Government-Work) - Commercial use
- Allowed
Credit the source with this exact text:
The data was obtained from National Aeronautics and Space Administration (NASA) Langley Research Center's Prediction Of Worldwide Energy Resources (POWER) project funded through the NASA Earth Science Division. The data was obtained from the POWER Project's Monthly and Annual API v2.10.0 on the retrieved_at date of this dataset version. Capital locations: Made with Natural Earth. Free vector and raster map data @ naturalearthdata.com.
Checked every 7 days. If the source hasn't changed in 75 days, the status page flags it as stale.
Endpoints
Every URL for this dataset. To pin the current version, put it after the id:
/v1/world-capitals@<version>.
The API reference describes each response.
| What | URL |
|---|---|
| Metadata: version, coverage, downloads, validation | /v1/world-capitals |
| Versions and monthly snapshots | /v1/world-capitals/versions |
| Series and locations | /v1/world-capitals/locations |
| Air temperature at 2 m, monthly mean (°C) (JSON) | /v1/world-capitals/tavg/{location}.json |
| Air temperature at 2 m, monthly mean (°C) (CSV) | /v1/world-capitals/tavg/{location}.csv |
| Whole dataset (CSV) | /v1/world-capitals/download/world-capitals.csv |
| Whole dataset (Parquet) | /v1/world-capitals/download/world-capitals.parquet |