Skip to content

Instantly share code, notes, and snippets.

@samapriya
Created August 1, 2025 06:07
Show Gist options
  • Select an option

  • Save samapriya/9a1ab005f9786ae4456238039be4d556 to your computer and use it in GitHub Desktop.

Select an option

Save samapriya/9a1ab005f9786ae4456238039be4d556 to your computer and use it in GitHub Desktop.
{
"openapi": "3.1.0",
"info": {
"title": "Climate Engine Time Series API v1",
"version": "1.0.0",
"description": "Access time series data from petabytes of satellite-driven climate and weather datasets through our powerful REST API. Extract historical and forecast time series data for points, polygons, and feature collections."
},
"servers": [
{
"url": "https://api.climateengine.org",
"description": "Production Climate Engine API"
}
],
"paths": {
"/timeseries/native/coordinates": {
"get": {
"tags": ["timeseries/native"],
"summary": "Native Time Series for Coordinates",
"description": "Extract native time series data for specific point or polygon coordinates. Returns raw daily values for the specified variables and date range.\n\n**Use Case:** Get daily temperature, precipitation, or other climate data for a specific location or area.\n\n**Example URL:**\n```\n/timeseries/native/coordinates?coordinates=[[-121.61,38.78]]&dataset=GRIDMET&variable=tmmn,tmmx&start_date=2023-01-01&end_date=2023-12-31\n```",
"operationId": "native_coordinates_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Point or polygon coordinates in GeoJSON format",
"default": "[[-121.61,38.78]]",
"title": "Coordinates"
},
"description": "**Required.** Point coordinates as `[[longitude, latitude]]` or polygon coordinates as nested arrays. See [Formatting Coordinates](https://support.climateengine.org/article/152-formatting-coordinates-for-api-requests) for detailed examples.",
"example": "[[-121.61,38.78]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"GRIDMET",
"PRISM_MONTHLY_4k",
"LANDSAT_TOA",
"MODIS_MOD13Q1",
"CFS_GRIDMET"
],
"description": "Climate or remote sensing dataset",
"default": "GRIDMET",
"title": "Dataset"
},
"description": "**Required.** Dataset to query. Popular options:\n- `GRIDMET` - Daily meteorological data (1979-present)\n- `PRISM_MONTHLY_4k` - Monthly precipitation and temperature\n- `LANDSAT_TOA` - Landsat satellite imagery\n- `CFS_GRIDMET` - Climate forecast data",
"example": "GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Variable names (comma-separated for multiple)",
"default": "tmmn,tmmx",
"title": "Variable"
},
"description": "**Required.** Climate variables to extract. Common GRIDMET variables:\n- `tmmn` - Minimum temperature\n- `tmmx` - Maximum temperature\n- `pr` - Precipitation\n- `pet` - Potential evapotranspiration\n- `vs` - Wind speed\n- `rh` - Relative humidity",
"example": "tmmx"
},
{
"name": "start_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2018-01-01",
"title": "Start Date"
},
"description": "**Required.** Start date in YYYY-MM-DD format.",
"example": "2023-01-01"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2018-01-02",
"title": "End Date"
},
"description": "**Required.** End date in YYYY-MM-DD format.",
"example": "2023-12-31"
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum", "stdDev"],
"description": "Spatial aggregation method for polygon areas",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate data spatially within polygons:\n- `mean` - Average value\n- `median` - Median value\n- `min` - Minimum value\n- `max` - Maximum value\n- `sum` - Sum of values\n- `stdDev` - Standard deviation",
"example": "mean"
},
{
"name": "simplify_geometry",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Simplify geometry with maxError in meters",
"default": "None",
"title": "Simplify Geometry"
},
"description": "Optional geometry simplification. Specify maxError in meters to reduce polygon complexity. See [ee.Feature.simplify](https://developers.google.com/earth-engine/apidocs/ee-feature-simplify) for details.",
"example": "1000"
},
{
"name": "buffer",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 0,
"title": "Buffer"
},
"description": "Buffer distance in meters to expand the geometry.",
"example": 5000
},
{
"name": "compute_trends",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated trend calculations",
"default": "",
"title": "Compute Trends"
},
"description": "Optional trend analysis. Options:\n- `polyfit` - Linear regression trend\n- `sens_slope` - Sen's slope (non-parametric trend)",
"example": "polyfit,sens_slope"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the time series data.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Time series data successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Time series data points",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date",
"description": "Date of observation"
},
"values": {
"type": "object",
"description": "Variable values for this date",
"additionalProperties": {
"type": "number"
}
}
}
}
},
"metadata": {
"type": "object",
"description": "Request metadata and statistics"
}
}
},
"example": {
"data": [
{
"date": "2023-01-01",
"values": {
"tmmx": 285.5,
"tmmn": 275.2
}
},
{
"date": "2023-01-02",
"values": {
"tmmx": 287.1,
"tmmn": 276.8
}
}
],
"metadata": {
"dataset": "GRIDMET",
"variables": ["tmmx", "tmmn"],
"coordinates": [[-121.61, 38.78]],
"count": 365
}
}
}
}
},
"400": {
"description": "Invalid parameters provided",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
},
"401": {
"description": "Authentication required - invalid or missing API key"
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/timeseries/native/feature_collection": {
"get": {
"tags": ["timeseries/native"],
"summary": "Native Time Series for Feature Collection",
"description": "Extract native time series data for features in an Earth Engine FeatureCollection. Useful for administrative boundaries, watersheds, or custom polygon datasets.\n\n**Use Case:** Get climate data for multiple counties, watersheds, or other predefined geographic areas.\n\n**Example URL:**\n```\n/timeseries/native/feature_collection?feature_collection_asset_id=USGS/WBD/2017/HUC12&filter_by=huc12&sub_choices=140300051008&dataset=GRIDMET&variable=pr,pet\n```",
"operationId": "native_feature_collection_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID or Climate Engine Asset",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID or Climate Engine Asset. Popular collections:\n- `USGS/WBD/2017/HUC12` - Watershed boundaries\n- `TIGER/2018/Counties` - US counties\n- `FAO/GAUL_SIMPLIFIED_500m/2015/level1` - Global administrative areas\n\nSee [Climate Engine Assets](https://docs.climateengine.org/docs/build/html/climate_engine_assets.html) for more options.",
"example": "USGS/WBD/2017/HUC12"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Column name in the FeatureCollection to use for filtering. For example:\n- `huc12` for watershed codes\n- `NAME` for county names\n- `GEOID` for census IDs",
"example": "huc12"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include. Multiple values can be separated by commas to process multiple features at once.",
"example": "140300051008,140300051009"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"GRIDMET",
"PRISM_MONTHLY_4k",
"LANDSAT_TOA",
"MODIS_MOD13Q1"
],
"description": "Climate or remote sensing dataset",
"default": "GRIDMET",
"title": "Dataset"
},
"description": "**Required.** Dataset to query.",
"example": "GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Variable names (comma-separated)",
"default": "tmmn,tmmx",
"title": "Variable"
},
"description": "**Required.** Climate variables to extract.",
"example": "pr,pet"
},
{
"name": "start_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2018-01-01",
"title": "Start Date"
},
"description": "**Required.** Start date in YYYY-MM-DD format.",
"example": "2023-01-01"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2018-01-02",
"title": "End Date"
},
"description": "**Required.** End date in YYYY-MM-DD format.",
"example": "2023-12-31"
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum", "stdDev"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate data spatially within each feature.",
"example": "mean"
},
{
"name": "compute_trends",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated trend calculations",
"default": "",
"title": "Compute Trends"
},
"description": "Optional trend analysis. Options:\n- `polyfit` - Linear regression trend\n- `sens_slope` - Sen's slope (non-parametric trend)",
"example": "polyfit,sens_slope"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the time series data.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Time series data successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Time series data for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"timeseries": {
"type": "array",
"description": "Time series data points",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date"
},
"values": {
"type": "object",
"additionalProperties": {
"type": "number"
}
}
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/timeseries/native/forecasts/coordinates": {
"get": {
"tags": ["timeseries/forecasts"],
"summary": "Forecast Time Series for Coordinates",
"description": "Extract forecast time series data for specific coordinates. Access climate forecast models like CFS (Climate Forecast System) to get future climate projections.\n\n**Use Case:** Get weather forecasts and seasonal climate outlooks for specific locations.\n\n**Example URL:**\n```\n/timeseries/native/forecasts/coordinates?coordinates=[[-121.61,38.78]]&dataset=CFS_GRIDMET&variable=tmmx&model=ens_mean\n```",
"operationId": "forecast_coordinates_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Point or polygon coordinates",
"default": "[[-121.61,38.78]]",
"title": "Coordinates"
},
"description": "**Required.** Point or polygon coordinates for forecast extraction.",
"example": "[[-121.61,38.78]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["CFS_GRIDMET"],
"description": "Forecast dataset",
"default": "CFS_GRIDMET",
"title": "Dataset"
},
"description": "**Required.** Forecast dataset. Currently supported:\n- `CFS_GRIDMET` - Climate Forecast System reanalysis with GRIDMET bias correction",
"example": "CFS_GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["tmmx", "tmmn", "pr", "pet"],
"description": "Forecast variable",
"default": "tmmx",
"title": "Variable"
},
"description": "**Required.** Climate variable to forecast:\n- `tmmx` - Maximum temperature\n- `tmmn` - Minimum temperature\n- `pr` - Precipitation\n- `pet` - Potential evapotranspiration",
"example": "tmmx"
},
{
"name": "model",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"ens01",
"ens02",
"ens03",
"ens04",
"ens05",
"ens06",
"ens07",
"ens08",
"ens09",
"ens10",
"ens11",
"ens12",
"ens13",
"ens14",
"ens15",
"ens16",
"ens17",
"ens18",
"ens19",
"ens20",
"ens21",
"ens22",
"ens23",
"ens24",
"ens25",
"ens26",
"ens27",
"ens28",
"ens_mean",
"ens_median",
"ens_min",
"ens_max"
],
"description": "Ensemble model selection",
"default": "ens_mean",
"title": "Model"
},
"description": "**Required.** Forecast ensemble member or statistic:\n- `ens01` to `ens28` - Individual ensemble members\n- `ens_mean` - Mean across all ensembles\n- `ens_median` - Median across all ensembles\n- `ens_min` - Minimum across all ensembles\n- `ens_max` - Maximum across all ensembles",
"example": "ens_mean"
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate forecast data spatially within polygons.",
"example": "mean"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the forecast time series data.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Forecast time series data successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"forecast_data": {
"type": "array",
"description": "Forecast time series by lead time",
"items": {
"type": "object",
"properties": {
"lead_day": {
"type": "integer",
"description": "Forecast lead time in days"
},
"forecast_date": {
"type": "string",
"format": "date",
"description": "Target forecast date"
},
"value": {
"type": "number",
"description": "Forecast value"
}
}
}
},
"metadata": {
"type": "object",
"properties": {
"forecast_issue_date": {
"type": "string",
"format": "date",
"description": "Date forecast was issued"
},
"model": {
"type": "string",
"description": "Ensemble model used"
},
"variable": {
"type": "string",
"description": "Climate variable"
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/timeseries/native/forecasts/feature_collection": {
"get": {
"tags": ["timeseries/forecasts"],
"summary": "Forecast Time Series for Feature Collection",
"description": "Extract forecast time series data for features in an Earth Engine FeatureCollection. Access climate forecast models to get future climate projections for multiple geographic areas.\n\n**Use Case:** Get weather forecasts and seasonal climate outlooks for multiple watersheds, counties, or other predefined geographic areas.\n\n**Example URL:**\n```\n/timeseries/native/forecasts/feature_collection?feature_collection_asset_id=USGS/WBD/2017/HUC12&filter_by=huc12&sub_choices=140300051008&dataset=CFS_GRIDMET&variable=pr&model=ens_mean\n```",
"operationId": "forecast_feature_collection_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID or Climate Engine Asset",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID or Climate Engine Asset. Popular collections:\n- `USGS/WBD/2017/HUC12` - Watershed boundaries\n- `TIGER/2018/Counties` - US counties\n- `FAO/GAUL_SIMPLIFIED_500m/2015/level1` - Global administrative areas\n\nSee [Climate Engine Assets](https://docs.climateengine.org/docs/build/html/climate_engine_assets.html) for more options.",
"example": "USGS/WBD/2017/HUC12"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Column name in the FeatureCollection to use for filtering.",
"example": "huc12"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include for forecast extraction.",
"example": "140300051008,140300051009"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["CFS_GRIDMET", "FRET", "GEPS_2WK", "GEPS_4WK"],
"description": "Forecast dataset",
"default": "CFS_GRIDMET",
"title": "Dataset"
},
"description": "**Required.** Forecast dataset to query.",
"example": "CFS_GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["tmmx", "tmmn", "pr", "pet"],
"description": "Forecast variable",
"default": "tmmx",
"title": "Variable"
},
"description": "**Required.** Climate variable to forecast.",
"example": "pr"
},
{
"name": "model",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"ens01",
"ens02",
"ens03",
"ens04",
"ens05",
"ens06",
"ens07",
"ens08",
"ens09",
"ens10",
"ens11",
"ens12",
"ens13",
"ens14",
"ens15",
"ens16",
"ens17",
"ens18",
"ens19",
"ens20",
"ens21",
"ens22",
"ens23",
"ens24",
"ens25",
"ens26",
"ens27",
"ens28",
"ens_mean",
"ens_median",
"ens_min",
"ens_max"
],
"description": "Ensemble model selection",
"default": "ens_mean",
"title": "Model"
},
"description": "**Required.** Forecast ensemble member or statistic.",
"example": "ens_mean"
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate forecast data spatially within each feature.",
"example": "mean"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the forecast time series data.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Forecast time series data successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Forecast time series data for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"forecast_data": {
"type": "array",
"description": "Forecast time series data points",
"items": {
"type": "object",
"properties": {
"lead_day": {
"type": "integer",
"description": "Forecast lead time in days"
},
"forecast_date": {
"type": "string",
"format": "date"
},
"value": {
"type": "number"
}
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/timeseries/standard_index/coordinates": {
"get": {
"tags": ["timeseries/drought"],
"summary": "Drought Index Time Series for Coordinates",
"description": "Extract standardized drought indices (SPI, SPEI, EDDI) time series for specific coordinates. These indices quantify moisture conditions relative to historical averages.\n\n**Use Case:** Monitor drought conditions and trends using scientifically-established drought indices.\n\n**Available Indices:**\n- **SPI** - Standardized Precipitation Index\n- **SPEI** - Standardized Precipitation Evapotranspiration Index \n- **EDDI** - Evaporative Demand Drought Index\n\n**Example URL:**\n```\n/timeseries/standard_index/coordinates?coordinates=[[-121.61,38.78]]&dataset=GRIDMET&variable=spi&accumulation=3&distribution=gamma\n```",
"operationId": "standard_index_coordinates_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Point or polygon coordinates",
"default": "[[-121.61,38.78]]",
"title": "Coordinates"
},
"description": "**Required.** Point or polygon coordinates for drought index extraction.",
"example": "[[-121.61,38.78]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["GRIDMET", "PRISM_MONTHLY_4k"],
"description": "Climate dataset",
"default": "PRISM_MONTHLY_4k",
"title": "Dataset"
},
"description": "**Required.** Base climate dataset for drought index calculation:\n- `GRIDMET` - Daily meteorological data\n- `PRISM_MONTHLY_4k` - Monthly precipitation and temperature data",
"example": "GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["spi", "spei", "eddi", "speih", "edddih"],
"description": "Drought index variable",
"default": "spi",
"title": "Variable"
},
"description": "**Required.** Drought index to calculate:\n- `spi` - Standardized Precipitation Index\n- `spei` - Standardized Precipitation Evapotranspiration Index\n- `eddi` - Evaporative Demand Drought Index\n- `speih` - SPEI with humidity adjustment\n- `edddih` - EDDI with humidity adjustment",
"example": "spi"
},
{
"name": "accumulation",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["1", "3", "6", "12", "24", "30", "365"],
"description": "Accumulation period in months or days",
"default": "3",
"title": "Accumulation"
},
"description": "Time scale for drought index calculation (e.g., 1, 3, 6, 12, 24 for months).",
"example": "3"
},
{
"name": "distribution",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["gamma", "nonparametric", "loglogistic"],
"description": "Statistical distribution for standardization",
"default": "gamma",
"title": "Distribution"
},
"description": "Statistical distribution used for standardization:\n- `gamma` - Gamma distribution (most common for precipitation)\n- `nonparametric` - Non-parametric approach\n- `loglogistic` - Log-logistic distribution",
"example": "gamma"
},
{
"name": "start_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2018-01-01",
"title": "Start Date"
},
"description": "**Required.** Start date for drought index time series.",
"example": "2020-01-01"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2018-01-02",
"title": "End Date"
},
"description": "**Required.** End date for drought index time series.",
"example": "2023-12-31"
},
{
"name": "start_year",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 1991,
"title": "Start Year"
},
"description": "Start year for climatological baseline period used in standardization.",
"example": 1981
},
{
"name": "end_year",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 2020,
"title": "End Year"
},
"description": "End year for climatological baseline period used in standardization.",
"example": 2010
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate drought index values spatially within polygons.",
"example": "mean"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the drought index time series.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Drought index time series successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Drought index time series",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date",
"description": "Date of observation"
},
"drought_index_value": {
"type": "number",
"description": "Standardized drought index value"
},
"drought_category": {
"type": "string",
"enum": [
"Exceptionally Wet",
"Severely Wet",
"Moderately Wet",
"Near Normal",
"Moderately Dry",
"Severely Dry",
"Exceptionally Dry"
],
"description": "Drought category classification"
}
}
}
},
"metadata": {
"type": "object",
"properties": {
"index": {
"type": "string",
"description": "Drought index calculated"
},
"accumulation": {
"type": "string",
"description": "Time accumulation period"
},
"distribution": {
"type": "string",
"description": "Statistical distribution used"
},
"baseline_period": {
"type": "string",
"description": "Climatological baseline period"
}
}
}
}
},
"example": {
"data": [
{
"date": "2020-01-01",
"drought_index_value": -0.5,
"drought_category": "Moderately Dry"
},
{
"date": "2020-02-01",
"drought_index_value": 0.8,
"drought_category": "Near Normal"
}
],
"metadata": {
"index": "spi",
"accumulation": "3",
"distribution": "gamma",
"baseline_period": "1981-2010"
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/timeseries/standard_index/feature_collection": {
"get": {
"tags": ["timeseries/drought"],
"summary": "Drought Index Time Series for Feature Collection",
"description": "Extract standardized drought indices (SPI, SPEI, EDDI) time series for features in an Earth Engine FeatureCollection. Monitor drought conditions across multiple geographic areas using scientifically-established drought indices.\n\n**Use Case:** Monitor drought conditions and trends for multiple watersheds, counties, or other administrative boundaries.\n\n**Example URL:**\n```\n/timeseries/standard_index/feature_collection?feature_collection_asset_id=USGS/WBD/2017/HUC12&filter_by=huc12&sub_choices=140300051008&dataset=GRIDMET&variable=spi&accumulation=3\n```",
"operationId": "standard_index_feature_collection_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID or Climate Engine Asset",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID or Climate Engine Asset for drought index analysis.",
"example": "USGS/WBD/2017/HUC12"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Column name in the FeatureCollection to use for filtering.",
"example": "huc12"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include for drought index calculation.",
"example": "140300051008,140300051009"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["GRIDMET", "PRISM_MONTHLY_4k"],
"description": "Climate dataset",
"default": "PRISM_MONTHLY_4k",
"title": "Dataset"
},
"description": "**Required.** Base climate dataset for drought index calculation.",
"example": "GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["spi", "spei", "eddi", "speih", "edddih"],
"description": "Drought index variable",
"default": "spi",
"title": "Variable"
},
"description": "**Required.** Drought index to calculate.",
"example": "spi"
},
{
"name": "accumulation",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["1", "3", "6", "12", "24", "30", "365"],
"description": "Accumulation period in months or days",
"default": "3",
"title": "Accumulation"
},
"description": "Time scale for drought index calculation.",
"example": "3"
},
{
"name": "distribution",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["gamma", "nonparametric", "loglogistic"],
"description": "Statistical distribution for standardization",
"default": "gamma",
"title": "Distribution"
},
"description": "Statistical distribution used for standardization.",
"example": "gamma"
},
{
"name": "start_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2018-01-01",
"title": "Start Date"
},
"description": "**Required.** Start date for drought index time series.",
"example": "2020-01-01"
},
{
"name": "end_date",
"in": "query",
"required": true,
"schema": {
"type": "string",
"format": "date",
"default": "2018-01-02",
"title": "End Date"
},
"description": "**Required.** End date for drought index time series.",
"example": "2023-12-31"
},
{
"name": "start_year",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 1991,
"title": "Start Year"
},
"description": "Start year for climatological baseline period.",
"example": 1981
},
{
"name": "end_year",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 2020,
"title": "End Year"
},
"description": "End year for climatological baseline period.",
"example": 2010
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate drought index values spatially within each feature.",
"example": "mean"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the drought index time series.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Drought index time series successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Drought index time series data for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"drought_timeseries": {
"type": "array",
"description": "Drought index time series data points",
"items": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date"
},
"drought_index_value": {
"type": "number"
},
"drought_category": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/timeseries/interannual/coordinates": {
"get": {
"tags": ["timeseries/summary"],
"summary": "Interannual Summary Time Series for Coordinates",
"description": "Extract annual or seasonal summary statistics for climate variables. Creates time series of yearly aggregated values (e.g., annual precipitation totals, average summer temperatures).\n\n**Use Case:** Analyze long-term climate trends and variability by examining annual or seasonal summaries.\n\n**Example URL:**\n```\n/timeseries/interannual/coordinates?coordinates=[[-121.61,38.78]]&dataset=GRIDMET&variable=pr&temporal_statistic=total&start_month=1&end_month=12&start_year=1980&end_year=2023\n```",
"operationId": "interannual_coordinates_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Point or polygon coordinates",
"default": "[[-121.61,38.78]]",
"title": "Coordinates"
},
"description": "**Required.** Point or polygon coordinates for summary extraction.",
"example": "[[-121.61,38.78]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"GRIDMET",
"PRISM_MONTHLY_4k",
"LANDSAT_TOA",
"MODIS_MOD13Q1"
],
"description": "Climate or remote sensing dataset",
"default": "GRIDMET",
"title": "Dataset"
},
"description": "**Required.** Dataset to query for interannual analysis.",
"example": "GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Variable names (comma-separated)",
"default": "tmmn,tmmx",
"title": "Variable"
},
"description": "**Required.** Climate variables for interannual summary.",
"example": "pr"
},
{
"name": "temporal_statistic",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"mean",
"median",
"min",
"max",
"total",
"range",
"stdDev"
],
"description": "Temporal aggregation method",
"default": "mean",
"title": "Temporal Statistic"
},
"description": "**Required.** How to aggregate data temporally within each year/season:\n- `mean` - Average value\n- `median` - Median value\n- `min` - Minimum value\n- `max` - Maximum value\n- `total` - Sum (useful for precipitation)\n- `range` - Difference between max and min\n- `stdDev` - Standard deviation",
"example": "total"
},
{
"name": "start_month",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 12,
"default": 1,
"title": "Start Month"
},
"description": "Starting month for seasonal aggregation (1=January, 12=December).",
"example": 6
},
{
"name": "end_month",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 12,
"default": 12,
"title": "End Month"
},
"description": "Ending month for seasonal aggregation (1=January, 12=December).",
"example": 8
},
{
"name": "start_day",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 31,
"default": 1,
"title": "Start Day"
},
"description": "Starting day of month for seasonal aggregation.",
"example": 1
},
{
"name": "end_day",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 31,
"default": 30,
"title": "End Day"
},
"description": "Ending day of month for seasonal aggregation.",
"example": 31
},
{
"name": "start_year",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 1991,
"title": "Start Year"
},
"description": "**Required.** First year for interannual time series.",
"example": 1980
},
{
"name": "end_year",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 2020,
"title": "End Year"
},
"description": "**Required.** Last year for interannual time series.",
"example": 2023
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate data spatially within polygons.",
"example": "mean"
},
{
"name": "compute_trends",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated trend calculations",
"default": "",
"title": "Compute Trends"
},
"description": "Optional trend analysis on interannual time series:\n- `polyfit` - Linear regression trend\n- `sens_slope` - Sen's slope (non-parametric trend)",
"example": "polyfit,sens_slope"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the interannual time series.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Interannual time series successfully retrieved",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "Annual/seasonal summary values",
"items": {
"type": "object",
"properties": {
"year": {
"type": "integer",
"description": "Year of summary"
},
"values": {
"type": "object",
"description": "Variable summary values for this year",
"additionalProperties": {
"type": "number"
}
}
}
}
},
"trends": {
"type": "object",
"description": "Trend analysis results (if requested)",
"properties": {
"polyfit": {
"type": "object",
"properties": {
"slope": {
"type": "number"
},
"intercept": {
"type": "number"
},
"r_squared": {
"type": "number"
}
}
},
"sens_slope": {
"type": "object",
"properties": {
"slope": {
"type": "number"
},
"p_value": {
"type": "number"
}
}
}
}
},
"metadata": {
"type": "object",
"description": "Request metadata and statistics"
}
}
},
"example": {
"data": [
{
"year": 1980,
"values": {
"pr": 1250.5
}
},
{
"year": 1981,
"values": {
"pr": 1180.2
}
}
],
"trends": {
"polyfit": {
"slope": -2.1,
"intercept": 1300,
"r_squared": 0.23
}
},
"metadata": {
"season": "June-August",
"temporal_statistic": "total",
"years": 44
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/timeseries/interannual/feature_collection": {
"get": {
"tags": ["timeseries/summary"],
"summary": "Interannual Summary Time Series for Feature Collection",
"description": "Extract annual or seasonal summary statistics for climate variables across features in an Earth Engine FeatureCollection. Creates time series of yearly aggregated values for multiple geographic areas.\n\n**Use Case:** Analyze long-term climate trends and variability across multiple watersheds, counties, or other administrative boundaries.\n\n**Example URL:**\n```\n/timeseries/interannual/feature_collection?feature_collection_asset_id=USGS/WBD/2017/HUC12&filter_by=huc12&sub_choices=140300051008&dataset=GRIDMET&variable=pr&temporal_statistic=total\n```",
"operationId": "interannual_feature_collection_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID or Climate Engine Asset",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID or Climate Engine Asset for interannual analysis.",
"example": "USGS/WBD/2017/HUC12"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Column name in the FeatureCollection to use for filtering.",
"example": "huc12"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include for analysis.",
"example": "140300051008,140300051009"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"GRIDMET",
"PRISM_MONTHLY_4k",
"LANDSAT_TOA",
"MODIS_MOD13Q1"
],
"description": "Climate or remote sensing dataset",
"default": "GRIDMET",
"title": "Dataset"
},
"description": "**Required.** Dataset to query for interannual analysis.",
"example": "GRIDMET"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Variable names (comma-separated)",
"default": "tmmn,tmmx",
"title": "Variable"
},
"description": "**Required.** Climate variables for interannual summary.",
"example": "pr"
},
{
"name": "temporal_statistic",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"mean",
"median",
"min",
"max",
"total",
"range",
"stdDev"
],
"description": "Temporal aggregation method",
"default": "mean",
"title": "Temporal Statistic"
},
"description": "**Required.** How to aggregate data temporally within each year/season.",
"example": "total"
},
{
"name": "start_month",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 12,
"default": 1,
"title": "Start Month"
},
"description": "Starting month for seasonal aggregation.",
"example": 6
},
{
"name": "end_month",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 12,
"default": 12,
"title": "End Month"
},
"description": "Ending month for seasonal aggregation.",
"example": 8
},
{
"name": "start_day",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 31,
"default": 1,
"title": "Start Day"
},
"description": "Starting day of month for seasonal aggregation.",
"example": 1
},
{
"name": "end_day",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 31,
"default": 30,
"title": "End Day"
},
"description": "Ending day of month for seasonal aggregation.",
"example": 31
},
{
"name": "start_year",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 1991,
"title": "Start Year"
},
"description": "**Required.** First year for interannual time series.",
"example": 1980
},
{
"name": "end_year",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 2020,
"title": "End Year"
},
"description": "**Required.** Last year for interannual time series.",
"example": 2023
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate data spatially within each feature.",
"example": "mean"
},
{
"name": "compute_trends",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated trend calculations",
"default": "",
"title": "Compute Trends"
},
"description": "Optional trend analysis on interannual time series.",
"example": "polyfit,sens_slope"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the interannual time series.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Interannual time series successfully retrieved for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Interannual time series data for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"interannual_data": {
"type": "array",
"description": "Annual/seasonal summary data points",
"items": {
"type": "object",
"properties": {
"year": {
"type": "integer"
},
"values": {
"type": "object",
"additionalProperties": {
"type": "number"
}
}
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/timeseries/regression/coordinates": {
"get": {
"tags": ["timeseries/regression"],
"summary": "Regression Analysis Time Series for Coordinates",
"description": "Perform regression analysis between two climate variables for specific coordinates. Analyzes relationships and correlations between different climate metrics over time.\n\n**Use Case:** Analyze relationships between climate variables (e.g., temperature vs. precipitation, NDVI vs. rainfall) to understand climate interactions and dependencies.\n\n**Example URL:**\n```\n/timeseries/regression/coordinates?coordinates=[[-121.61,38.78]]&dataset=LANDSAT_TOA&variable=NDVI&var2_dataset=GRIDMET&var2_variable=pr&start_year=2016&end_year=2020\n```",
"operationId": "regression_coordinates_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "coordinates",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Point or polygon coordinates",
"default": "[[-121.61,38.78]]",
"title": "Coordinates"
},
"description": "**Required.** Point or polygon coordinates for regression analysis.",
"example": "[[-121.61,38.78]]"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"GRIDMET",
"PRISM_MONTHLY_4k",
"LANDSAT_TOA",
"MODIS_MOD13Q1"
],
"description": "Primary dataset for first variable",
"default": "LANDSAT_TOA",
"title": "Dataset"
},
"description": "**Required.** Dataset for the first variable in regression analysis.",
"example": "LANDSAT_TOA"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Primary variable name",
"default": "NDVI",
"title": "Variable"
},
"description": "**Required.** First variable for regression analysis.",
"example": "NDVI"
},
{
"name": "var2_dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"GRIDMET",
"PRISM_MONTHLY_4k",
"LANDSAT_TOA",
"MODIS_MOD13Q1"
],
"description": "Secondary dataset for second variable",
"default": "GRIDMET",
"title": "Second Dataset"
},
"description": "**Required.** Dataset for the second variable in regression analysis.",
"example": "GRIDMET"
},
{
"name": "var2_variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Secondary variable name",
"default": "pr",
"title": "Second Variable"
},
"description": "**Required.** Second variable for regression analysis.",
"example": "pr"
},
{
"name": "temporal_statistic",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "total"],
"description": "Temporal aggregation for first variable",
"default": "mean",
"title": "Temporal Statistic"
},
"description": "**Required.** How to aggregate the first variable temporally.",
"example": "mean"
},
{
"name": "var2_temporal_statistic",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "total"],
"description": "Temporal aggregation for second variable",
"default": "sum",
"title": "Second Temporal Statistic"
},
"description": "**Required.** How to aggregate the second variable temporally.",
"example": "sum"
},
{
"name": "start_month",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 12,
"default": 1,
"title": "Start Month"
},
"description": "Starting month for seasonal aggregation.",
"example": 1
},
{
"name": "end_month",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 12,
"default": 12,
"title": "End Month"
},
"description": "Ending month for seasonal aggregation.",
"example": 12
},
{
"name": "start_day",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 31,
"default": 1,
"title": "Start Day"
},
"description": "Starting day for first variable.",
"example": 1
},
{
"name": "end_day",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 31,
"default": 30,
"title": "End Day"
},
"description": "Ending day for first variable.",
"example": 30
},
{
"name": "var2_start_month",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 12,
"default": 1,
"title": "Second Start Month"
},
"description": "Starting month for second variable.",
"example": 1
},
{
"name": "var2_end_month",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 12,
"default": 12,
"title": "Second End Month"
},
"description": "Ending month for second variable.",
"example": 12
},
{
"name": "var2_start_day",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 31,
"default": 1,
"title": "Second Start Day"
},
"description": "Starting day for second variable.",
"example": 1
},
{
"name": "var2_end_day",
"in": "query",
"required": false,
"schema": {
"type": "integer",
"minimum": 1,
"maximum": 31,
"default": 30,
"title": "Second End Day"
},
"description": "Ending day for second variable.",
"example": 30
},
{
"name": "start_year",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 2016,
"title": "Start Year"
},
"description": "**Required.** First year for regression analysis.",
"example": 2016
},
{
"name": "end_year",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 2018,
"title": "End Year"
},
"description": "**Required.** Last year for regression analysis.",
"example": 2020
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate data spatially within polygons.",
"example": "mean"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the regression analysis results.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Regression analysis successfully completed",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"regression_results": {
"type": "object",
"properties": {
"correlation_coefficient": {
"type": "number",
"description": "Pearson correlation coefficient"
},
"r_squared": {
"type": "number",
"description": "Coefficient of determination"
},
"slope": {
"type": "number",
"description": "Linear regression slope"
},
"intercept": {
"type": "number",
"description": "Linear regression intercept"
},
"p_value": {
"type": "number",
"description": "Statistical significance p-value"
}
}
},
"data_pairs": {
"type": "array",
"description": "Annual data pairs used in regression",
"items": {
"type": "object",
"properties": {
"year": {
"type": "integer"
},
"variable1_value": {
"type": "number"
},
"variable2_value": {
"type": "number"
}
}
}
},
"metadata": {
"type": "object",
"description": "Analysis metadata"
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
},
"/timeseries/regression/feature_collection": {
"get": {
"tags": ["timeseries/regression"],
"summary": "Regression Analysis Time Series for Feature Collection",
"description": "Perform regression analysis between two climate variables for features in an Earth Engine FeatureCollection. Analyzes relationships across multiple geographic areas.\n\n**Use Case:** Analyze relationships between climate variables across multiple watersheds, counties, or other administrative boundaries to understand regional climate interactions.\n\n**Example URL:**\n```\n/timeseries/regression/feature_collection?feature_collection_asset_id=USGS/WBD/2017/HUC12&filter_by=huc12&sub_choices=140300051008&dataset=LANDSAT_TOA&variable=NDVI&var2_dataset=GRIDMET&var2_variable=pr\n```",
"operationId": "regression_feature_collection_timeseries",
"security": [
{
"APIKeyHeader": []
}
],
"parameters": [
{
"name": "feature_collection_asset_id",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Earth Engine FeatureCollection ID or Climate Engine Asset",
"default": "blm_ga_nv",
"title": "Feature Collection Asset Id"
},
"description": "**Required.** Earth Engine FeatureCollection ID or Climate Engine Asset for regression analysis.",
"example": "USGS/WBD/2017/HUC12"
},
{
"name": "filter_by",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Column attribute to filter features",
"default": "",
"title": "Filter By"
},
"description": "Column name in the FeatureCollection to use for filtering.",
"example": "huc12"
},
{
"name": "sub_choices",
"in": "query",
"required": false,
"schema": {
"type": "string",
"description": "Comma-separated values to filter features",
"default": "",
"title": "Sub Choices"
},
"description": "Specific feature values to include for regression analysis.",
"example": "140300051008,140300051009"
},
{
"name": "dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"GRIDMET",
"PRISM_MONTHLY_4k",
"LANDSAT_TOA",
"MODIS_MOD13Q1"
],
"description": "Primary dataset for first variable",
"default": "LANDSAT_TOA",
"title": "Dataset"
},
"description": "**Required.** Dataset for the first variable.",
"example": "LANDSAT_TOA"
},
{
"name": "variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Primary variable name",
"default": "NDVI",
"title": "Variable"
},
"description": "**Required.** First variable for regression analysis.",
"example": "NDVI"
},
{
"name": "var2_dataset",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"GRIDMET",
"PRISM_MONTHLY_4k",
"LANDSAT_TOA",
"MODIS_MOD13Q1"
],
"description": "Secondary dataset for second variable",
"default": "GRIDMET",
"title": "Second Dataset"
},
"description": "**Required.** Dataset for the second variable.",
"example": "GRIDMET"
},
{
"name": "var2_variable",
"in": "query",
"required": true,
"schema": {
"type": "string",
"description": "Secondary variable name",
"default": "pr",
"title": "Second Variable"
},
"description": "**Required.** Second variable for regression analysis.",
"example": "pr"
},
{
"name": "temporal_statistic",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "total"],
"description": "Temporal aggregation for first variable",
"default": "mean",
"title": "Temporal Statistic"
},
"description": "**Required.** How to aggregate the first variable temporally.",
"example": "mean"
},
{
"name": "var2_temporal_statistic",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "total"],
"description": "Temporal aggregation for second variable",
"default": "sum",
"title": "Second Temporal Statistic"
},
"description": "**Required.** How to aggregate the second variable temporally.",
"example": "sum"
},
{
"name": "start_year",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 2016,
"title": "Start Year"
},
"description": "**Required.** First year for regression analysis.",
"example": 2016
},
{
"name": "end_year",
"in": "query",
"required": true,
"schema": {
"type": "integer",
"minimum": 1895,
"maximum": 2024,
"default": 2018,
"title": "End Year"
},
"description": "**Required.** Last year for regression analysis.",
"example": 2020
},
{
"name": "area_reducer",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["mean", "median", "min", "max", "sum"],
"description": "Spatial aggregation method",
"default": "mean",
"title": "Area Reducer"
},
"description": "How to aggregate data spatially within each feature.",
"example": "mean"
},
{
"name": "export_format",
"in": "query",
"required": false,
"schema": {
"type": "string",
"enum": ["json", "csv"],
"title": "Export Format"
},
"description": "Output format for the regression analysis results.",
"example": "json"
}
],
"responses": {
"200": {
"description": "Regression analysis successfully completed for feature collection",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"features": {
"type": "array",
"description": "Regression analysis results for each feature",
"items": {
"type": "object",
"properties": {
"feature_id": {
"type": "string",
"description": "Feature identifier"
},
"properties": {
"type": "object",
"description": "Feature properties"
},
"regression_results": {
"type": "object",
"properties": {
"correlation_coefficient": {
"type": "number"
},
"r_squared": {
"type": "number"
},
"slope": {
"type": "number"
},
"intercept": {
"type": "number"
},
"p_value": {
"type": "number"
}
}
},
"data_pairs": {
"type": "array",
"items": {
"type": "object",
"properties": {
"year": {
"type": "integer"
},
"variable1_value": {
"type": "number"
},
"variable2_value": {
"type": "number"
}
}
}
}
}
}
}
}
}
}
}
},
"400": {
"description": "Invalid parameters provided"
},
"401": {
"description": "Authentication required"
},
"422": {
"description": "Validation Error"
}
}
}
}
},
"components": {
"schemas": {
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": ["loc", "msg", "type"],
"title": "ValidationError"
},
"TimeSeriesDataPoint": {
"type": "object",
"properties": {
"date": {
"type": "string",
"format": "date",
"description": "Date of the observation"
},
"values": {
"type": "object",
"description": "Climate variable values for this date",
"additionalProperties": {
"type": "number"
}
}
},
"required": ["date", "values"],
"title": "TimeSeriesDataPoint"
},
"CoordinateFormat": {
"type": "string",
"description": "Coordinates in GeoJSON format",
"examples": [
"[[-121.61,38.78]]",
"[[[-122.06, 39.16], [-122.06, 37.76], [-120.45, 37.76], [-120.45, 39.16]]]"
],
"title": "CoordinateFormat"
},
"ClimateVariable": {
"type": "string",
"enum": [
"tmmx",
"tmmn",
"pr",
"pet",
"vs",
"rh",
"sph",
"srad",
"th",
"fm100",
"fm1000",
"etr",
"erc",
"bi",
"vpd"
],
"description": "Climate variables available in GRIDMET dataset",
"title": "ClimateVariable"
},
"DroughtIndex": {
"type": "string",
"enum": ["spi", "spei", "eddi", "speih", "edddih"],
"description": "Standardized drought indices",
"title": "DroughtIndex"
}
},
"securitySchemes": {
"APIKeyHeader": {
"type": "apiKey",
"in": "header",
"name": "Authorization",
"description": "API key authentication. Format: `Bearer YOUR_API_KEY`"
}
}
},
"tags": [
{
"name": "timeseries/native",
"description": "Extract raw daily time series data from climate and remote sensing datasets"
},
{
"name": "timeseries/forecasts",
"description": "Access forecast time series data from climate prediction models"
},
{
"name": "timeseries/drought",
"description": "Calculate and extract standardized drought indices time series"
},
{
"name": "timeseries/summary",
"description": "Generate annual and seasonal summary statistics time series"
},
{
"name": "timeseries/regression",
"description": "Perform regression analysis between climate variables over time"
}
],
"externalDocs": {
"description": "Climate Engine Documentation",
"url": "https://docs.climateengine.org/"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment