Global Forest Watch

v0.2.1
io.github.pipeworx-io/global-forest-watch Checked 1 hour ago Published 29 days ago

The Global Forest Watch Data API from WRI and the University of Maryland — browse the datasets…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

gfw_datasets

List or keyword-search the Global Forest Watch Data API catalogue — the WRI/UMD datasets behind GFW: annual tree cover loss and gain, primary forest extent, GLAD/RADD deforestation alerts, fire alerts (VIIRS/MODIS), protected areas, concessions, Aqueduct water risk, carbon flux. Returns each dataset name (pass it to gfw_dataset or gfw_query), its title, tags and published versions. Keyless. AUTHORITATIVE for what forest-change data GFW actually publishes.

ParameterTypeDescription
limitnumberMax datasets to return (1-200, default 25).
pagenumberUpstream page number, 1-based (default 1). Each upstream page holds up to 100 datasets.
querystringOptional keyword filter, matched against dataset name, title and tags (e.g. "tree cover loss", "fire", "peat").

gfw_dataset

Full detail for ONE Global Forest Watch dataset — metadata (source, citation, spatial resolution, geographic coverage, update frequency, cautions, licence) plus its version list. Pass a version (or "latest") to also get that version's status, assets and field/band list, which is what gfw_query needs to build a valid SQL statement. Keyless.

ParameterTypeDescription
dataset *stringDataset name from gfw_datasets, e.g. "umd_tree_cover_loss".
versionstringOptional version, e.g. "latest" or "v1.13". Omit for dataset-level metadata only.

gfw_query

Run a read-only SQL SELECT against one Global Forest Watch dataset version — e.g. tree cover loss hectares by year inside an area, or deforestation alerts inside a bounding box. The table is always called `data`; use gfw_dataset to see the available columns first. Almost every GFW dataset (tree cover loss/gain, GLAD/RADD alerts, fire alerts, carbon, primary forest) is a RASTER TILE SET, not a plain table — a `geometry` (GeoJSON Polygon/MultiPolygon) is REQUIRED to scope the pixels queried, or the API answers 422 "Raster tile set queries require a geometry". Omit it only for the few vector-…

ParameterTypeDescription
_apiKey *stringYour own Global Forest Watch API key (BYO). Get one free at globalforestwatch.org: create an account, then POST /auth/token followed by POST /auth/apikey on data-api.globalforestwatch.org to mint an x…
dataset *stringDataset name, e.g. "umd_tree_cover_loss".
sql *stringA SELECT statement over the table `data`, e.g. "SELECT umd_tree_cover_loss__year, SUM(area__ha) AS loss_ha FROM data WHERE umd_tree_cover_loss__year > 0 GROUP BY umd_tree_cover_loss__year". SELECT onl…
geometryobjectGeoJSON Polygon or MultiPolygon ({"type":"Polygon","coordinates":[...]}) scoping the query spatially. REQUIRED for raster tile set datasets — which is most of them; see gfw_dataset's version_assets.…
limitnumberRow cap appended when your SQL has no LIMIT (1-1000, default 100).
versionstringVersion, e.g. "latest" or "v1.13". Default "latest".