Overview¶
GDEX exposes both file-level and dataset-level metadata for each dataset through dedicated endpoints. This notebook demonstrates how to retrieve and use these metadata fields.
Retrieve the dataset abstract and acknowledgement
Inspect spatial and temporal coverage
List variables and data formats
Check dataset volume and related datasets
Prerequisites¶
| Concepts | Importance | Notes |
|---|---|---|
| api_intro | Necessary | GDEX API base URL and response envelope |
| requests library | Necessary | |
| pandas | Helpful | Tabular display of results |
Time to learn: 20 minutes
Imports¶
import requests
import json
import pandas as pdDataset Abstract¶
GET /datasets/{dsid}/abstract/ returns cleaned text, extracted URLs, and any advisory notes.
BASE_URL = "https://gdex.ucar.edu/api"
DSID = "d084001" # GFS 0.25 degree forecasts
abstract = requests.get(f"{BASE_URL}/datasets/{DSID}/abstract/").json()
print(abstract["data"]["abstract"][:500])
The NCEP operational Global Forecast System analysis and forecast grids are on a 0.25 by 0.25 global latitude longitude grid. Grids include analysis and forecast time steps at a 3 hourly interval from 0 to 240, and a 12 hourly interval from 240 to 384. Model forecast runs occur at 00, 06, 12, and 18 UTC daily. For real-time data access please use the NCEP data server. s3.amazonaws.com/index.html">https://noaa-gfs-bdp-pds.s3.amazonaws.com/index.html). Therefore, the RDA will stop updating this da
Spatial and Temporal Coverage¶
GET /datasets/{dsid}/spatial_coverage/ returns bounding box, resolution, and grid dimensions. GET /datasets/{dsid}/temporal/ returns start/end dates and sub-group time ranges.
spatial = requests.get(f"{BASE_URL}/datasets/{DSID}/spatial_coverage/").json()
temporal = requests.get(f"{BASE_URL}/datasets/{DSID}/temporal/").json()
bounds = spatial["data"]["spatial_coverage"]["bounds"]
print(bounds)
print(f"Start data: {temporal['data']['temporal']['start_date']}")
print(f"End data: {temporal['data']['temporal']['end_date']}")
{'north': 90.0, 'south': -90.0, 'east': 180.0, 'west': -180.0, 'lat_units': 'degrees north', 'lon_units': 'degrees east'}
Start data: 2015-01-15 00:00 +0000
End data: 2026-12-14 12:00 +0000
Variables and detailed metadata¶
GET /paramsummary/{dsid} returns all variables. GET /metadata/{dsid}/ gives detailed inventory that you can filter.
print(f"{BASE_URL}/paramsummary/{DSID}/")
print(f"{BASE_URL}/metadata/{DSID}/")
variables = requests.get(f"{BASE_URL}/paramsummary/{DSID}/").json()
metadata = requests.get(f"{BASE_URL}/metadata/{DSID}/").json()
all_metadata = metadata["data"]["data"]
df = pd.DataFrame(all_metadata)
df
https://gdex.ucar.edu/api/paramsummary/d084001/
https://gdex.ucar.edu/api/metadata/d084001/
Now, you can filter to find more information about the contents of the dataset.¶
For example, let’s say I want to just get the parameters that are available at 500mb.
params_500mb = [
p for p in all_metadata
if any(
lvl.get("level_description") == "Isobaric surface" and
lvl.get("level_value") == "500"
for lvl in p.get("levels", [])
)]
#params_500mb
set([x['param_description'] for x in params_500mb]){'5-wave geopotential height',
'Absolute vorticity',
'Cloud water mixing ratio',
'Geopotential height',
'Graupel',
'Ice water mixing ratio',
'Icing severity',
'Ozone mixing ratio',
'Rain water mixing ratio',
'Relative humidity',
'Snow water mixing ratio',
'Specific humidity',
'Temperature',
'Total cloud cover',
'Vertical velocity (geometric)',
'Vertical velocity (pressure)',
'u-component of wind',
'v-component of wind'}Dataset Volume and Related Datasets¶
GET /datasets/{dsid}/volume/ reports total archive size. GET /datasets/{dsid}/related_datasets/ lists companion datasets.
volume = requests.get(f"{BASE_URL}/datasets/{DSID}/volume/").json()
related = requests.get(f"{BASE_URL}/datasets/{DSID}/related_datasets/").json()
print("Total volume:", volume["data"]["total_volume"])
Total volume: 675.73 TB
Summary¶
GDEX provides dedicated endpoints for every facet of dataset metadata — from abstract text and spatial bounds to variable lists and archive size — all following the same response envelope.