API Reference
Waterbody requests:
# Search for a waterbody
GET: /waterbody/{search}/{format}
POST: /waterbody
Search for a waterbody using search terms.
Parameters:
| name | description |
|---|---|
| search | Search keywords. If empty, all waterbodies will be returned. |
| format | Optional. The format to return data. Default is json, but csv is also supported. |
Return:
| name | type | description |
|---|---|---|
| [] | array | Returns an array of matches ordered by best match. However, if the search term was empty, all waterbodies will be returned sorted by waterbody ID (same as alphabetical ordering). |
| [].wid | number | The waterbody ID. |
| [].name | string | Waterbody name. |
| [].waterboardregion | number | The water board region. |
If no results are found, response will be of 404 status with message of no results found.
Example:
GET: https://fhab-api.sfei.org/waterbody/bay
Search for waterbodies with the search term "bay".
Results:
[
{
"wid": 31,
"name": "Central Bay"
},
{
"wid": 156,
"name": "Lower South Bay"
},
{
"wid": 192,
"name": "Richardson Bay"
},
{
"wid": 207,
"name": "San Pablo Bay"
},
{
"wid": 222,
"name": "South Bay"
},
{
"wid": 229,
"name": "Suisun Bay"
}
]
# Waterbody info
GET: /waterbody/{wid}/format
GET: /waterbody/{wid}/info/format
POST: /waterbody/info
Get the information of a waterbody.
Parameters:
| name | description |
|---|---|
| wid | The waterbody ID. |
| format | Optional. The format to return data. Default is json, but csv is also supported. |
Return:
| name | type | description |
|---|---|---|
| wid | number | The waterbody ID. |
| name | string | Waterbody name. |
| waterboardregion | number | The water board region. |
| type | string | Waterbody type classification. |
| usetype | string | Use type/suitability classification. |
| watertype | string | Secondary waterbody type classification. |
If no waterbody is found for the given waterbody ID, response will be of 404 status with not found message.
Example:
GET: https://fhab-api.sfei.org/waterbody/53/info
Get the information of the waterbody with ID=53.
Results:
{
"wid": 53,
"name": "Echo Lake, Upper and Lower",
"waterboardregion": 6,
"type": "Lake Perennial",
"usetype": "Limited",
"watertype": "Lake"
}
# Waterbody name
GET: /waterbody/{wid}/name/format
POST: /waterbody/name
Rerouted to waterbody info request. Deprecated but left in for backwards compatibility.
# Waterbody geometry
GET: /waterbody/{wid}/{format}
POST: /waterbody/{format}
Get the geometry of a waterbody. For it to be recognized as a geometry request, the format must be one of: geom, geometry, geojson, or kml.
Parameters:
| name | description |
|---|---|
| wid | The waterbody ID. |
| format | The format of the geometry. Must be one of: geom, geometry, geojson, or kml. All but kml returns as GeoJSON. |
Return:
Depending on the request format, returns GeoJSON formatted data or a KML file. If in GeoJSON format, of which some, but not necessarily all, of the main properties are listed below.
| name | type | description |
|---|---|---|
| type | string | The geometry type. |
| crs | object | The coordinate reference system. |
| crs.type | string | The CRS object type. |
| crs.properties | object | The CRS properties |
| crs.properties.name | string | The CRS name or EPSG identifier. |
| coordinates | array | An array of coordinates, at the inner-most level consisting of length-two arrays of coordinate pairs. The dimensionality depends on the geometry type. For multipolygons, the value will be in 4D for each feature, polygon, linear-ring, and coordinates. |
If no waterbody is found for the given waterbody ID, response will be of 404 status with not found message.
Example:
GET: https://fhab-api.sfei.org/waterbody/53/geojson
Get the geometry (as GeoJSON) for the waterbody with ID=53.
Results:
{
"type": "MultiPolygon",
"crs": {
"type": "name",
"properties": {
"name": "EPSG:32611"
}
},
"coordinates": [[[
[232502.646463832, 4304753.87],
[232788.41678906, 4304753.76],
[232802.646967078, 4304753.82],
[232807.390391706, 4304753.84],
/* ... */
]]]
}
Waterbody statistics requests:
# Single-date statistics on waterbody
GET: /{product}/{composite}/{wid}
POST: /{product} *
*POST requests to this endpoint will be interpreted based on the parameters supplied. Depending on which, the request may alternatively be interpreted as a date-span statistics request, raster request or pixel-value request.
Get the single-date, zonal waterbody statistics for the given product, composite, waterbody, and date.
Parameters:
| name | description |
|---|---|
| product | The data product type. See product definition. |
| composite | The type of composite. See composite definition. |
| wid | The waterbody ID. |
| date | The date for which to grab statistics. Must be in yyyymmdd or yyyy-mm-dd format. |
| valuetype | The units for the returned values. See value type definition. |
| stats | Optional value to limit the reported statistics. See statistics definition. Multiple values may be supplied separated by commas. The default is to return all statistics. |
| format | Optional. The format to return data. Default is json, but csv is also supported. |
Return:
| name | type | description |
|---|---|---|
| date | string | The requested date in yyyy-mm-dd format. |
| pixel_count | number | The observed pixel count for the given waterbody at the requested date. If mosaic data were requested, this represented the combined pixels observed between all platforms with available imagery. |
| pixel_counts | object | If mosaic data were requested, an object representing the platform name (as key) and pixel counts specific to the platform (as value) for the given waterbody at the requested date. |
| min | number | The observed minimum for the given waterbody at the requested date. |
| max | number | The observed maximum for the given waterbody at the requested date. |
| mean | number | The observed mean for the given waterbody at the requested date. |
| median | number | The observed median for the given waterbody at the requested date. |
| perc90 | number | The observed 90th percentile for the given waterbody at the requested date. |
Example:
GET: https://fhab-api.sfei.org/chlorophyll/1daymax/33/20210901/chl
Get the single-date statistics for September 1st, 2021 on Clear Lake (wid=33). Values are obtained from the chlorophyll products and 1-day pixel maximum composites and reported in standard chlorophyll units (μg/L).
Results:
{
"date": "2021-09-01",
"pixel_count": 1492,
"min": 16.65,
"max": 134.6,
"mean": 95.25,
"median": 98.49,
"perc90": 134.6
}
# Date span statistics on waterbody
GET: /{product}/{composite}/{wid}/{datefrom}
POST: /{product} *>
*POST requests to this endpoint will be interpreted based on the parameters supplied. Depending on which, the request may alternatively be interpreted as a single-date statistics request, raster request or pixel-value request.
Get the multi-date, zonal waterbody statistics for the given product, composite, waterbody, and date span.
Parameters:
| name | description |
|---|---|
| product | The data product type. See product definition. |
| composite | The type of composite. See composite definition. Note that for mosaic-based requests, the date-span is limited to ten days, due to additional the processing required as values are dynamically analyzed from the raster data. |
| wid | The waterbody ID. |
| datefrom | The start date, inclusive, from which to grab statistics. Must be in yyyymmdd or yyyy-mm-dd format. |
| datetill | The end date, inclusive, up to which to grab statistics. Must be in yyyymmdd or yyyy-mm-dd format. |
| valuetype | The units for the returned values. See value type definition. |
| stats | Optional value to limit the reported statistics. See statistics definition. Multiple values may be supplied separated by commas. The default is to return all statistics. |
| format | Optional. The format to return data. Default is json, but csv is also supported. |
Return:
| name | type | description |
|---|---|---|
| [] | object[] | Array of results, chronologically ordered, with each datum representing the statistics for a single date. |
| [].date | string | The dates for this datum in yyyy-mm-dd format. |
| [].pixel_count | number | The pixel counts for the given waterbody at the date of this datum. If mosaic data were requested, this represented the combined pixels observed between all platforms with available imagery. |
| [].pixel_counts | object | If mosaic data were requested, an object representing the platform name (as key) and pixel counts specific to the platform (as value) for the given waterbody at the date of this datum. |
| [].min | number | The minimum statistics for the given waterbody at the date of this datum. |
| [].max | number | The maximum statistics for the given waterbody at the date of this datum. |
| [].mean | number | The mean statistics for the given waterbody at the date of this datum. |
| [].median | number | The median statistics for the given waterbody at the date of this datum. |
| [].perc90 | number | The 90th percentile statistics for the given waterbody at the date of this datum. |
Example:
GET: https://fhab-api.sfei.org/cyano/10daymax/33/20210901/20210905/ci_modified
Get the statistics from September 1st to September 5th, 2021 on Clear Lake (wid=33). Values are obtained from the cyano products and 10-day pixel maximum composites and reported in modified cyano index.
Results:
[
{
"date": "2021-09-01",
"pixel_count": 1767,
"min": 0.9972436372799999,
"max": 870.9152991480801,
"mean": 136.66402495666,
"median": 148.48021460236,
"perc90": 448.60144272938
},
{
"date": "2021-09-02",
"pixel_count": 1770,
"min": 0.9972436372799999,
"max": 895.3250088022401,
"mean": 152.64176591190002,
"median": 148.48021460236,
"perc90": 448.60144272938
},
{
"date": "2021-09-03",
"pixel_count": 1771,
"min": 0.9972436372799999,
"max": 895.3250088022401,
"mean": 170.48752109134,
"median": 152.64176591190002,
"perc90": 461.17470049708
},
{
"date": "2021-09-04",
"pixel_count": 1767,
"min": 0.9972436372799999,
"max": 895.3250088022401,
"mean": 170.48752109134,
"median": 152.64176591190002,
"perc90": 448.60144272938
},
{
"date": "2021-09-05",
"pixel_count": 1772,
"min": 0.9972436372799999,
"max": 999.9998235943,
"mean": 175.26588535556,
"median": 156.91995944984,
"perc90": 461.17470049708
}
]
Raster requests:
# Raster information
GET: /{product}/{composite}/{date}/info
POST: /{product}/info
Get information about available raster(s) for given product, composite, and date.
Parameters:
| name | description |
|---|---|
| product | The data product type. See product definition. |
| composite | The type of composite. See composite definition. |
| date | The date of the requested raster. Must be in yyyymmdd or yyyy-mm-dd format. |
Return:
| name | type | description |
|---|---|---|
| sensor | string | The name of the sensor, which is limited to either MERIS or OLCI. |
| platform | string[] | An array of the available platforms operational on this date. Does not necessitate that all listed made a flyover or have available imagery for this date. |
| product | string | The data product type. See product definition. |
| composite | string | The type of composite. See composite definition. |
| datestr | string | The date in yyyymmdd format. |
| rasters | string|string[] | The filename(s) of the available raster(s). |
Example:
GET: https://fhab-api.sfei.org/cicyano/mosaic/20200609/info
Get information about available raster(s) on the date June 9th, 2020 for the CI cyano product and mosaics.
Results:
{
"sensor": "OLCI",
"platform": [
"sentinel-3a",
"sentinel-3b"
],
"product": "cicyano",
"composite": "mosaic",
"datestr": "20200609",
"rasters": [
"sentinel-3a.2020161.0609.L3.CA_mosaic.v950V20193_1_2.CIcyano.tif",
"sentinel-3b.2020161.0609.L3.CA_mosaic.v950V20193_1_2.CIcyano.tif"
]
}
# Single date raster(s)
GET: /{product}/{composite}/{date}/{format}
POST: /{product} *
*POST requests to this endpoint will be interpreted based on the parameters supplied. Depending on which, the request may alternatively be interpreted as a single-date statistics request, date-span statistics request, or pixel-value request.
Get the raster(s) for given product, composite, and date. Currently only the tiff format is supported.
Parameters:
| name | description |
|---|---|
| product | The data product type. See product definition. |
| composite | The type of composite. See composite definition. |
| date | The date of the requested raster. Must be in yyyymmdd or yyyy-mm-dd format. |
| format | The raster format. Currently only tiff (or alternatively spelled tif) is supported. Note that this parameter is also required. If not specified or unrecognized type, the request will be interpreted as a (malformed) single-date statistic request. |
Return:
The raster or rasters will be return in the format provided. If multiple rasters are returned, the file will be served as a zip file. Multiple files may result for mosaic products requests if overflights from both Sentinel-3A and Sentinel-3B are present.
Mosaic rasters are provided in the filename format:
[platform].[yyyyjjj].[mmdd].CA_mosiac.[version].[product].tif
Composite rasters are provided in the filename format:
ts.[start:yyyymmdd]_[end:yyyymmdd].L4.CA_mosiac.[product].[compositetype].tif
Composite rasters will have a date span indicating the start and end dates of the composite window (inclusive). The requested date will correspond to the end date of this window.
Rasters are provided with a color table for symbology. Pixel values are 0-255 and map to the values as indicated in the pixel values table.
Example:
GET: https://fhab-api.sfei.org/chlorophyll/1daymax/20220826/tif
Get the raster on the date August 26th, 2022 for the chlorophyll product using the 1-day pixel maximum composite.
Results:
ts.20220826_20220826.L4.CA_mosaic.chl_gil_rhos.MAX_1day.tif
# Monthly rasters
GET: /{product}/{composite}/{month}/{format}
POST: /{product} *
*POST requests to this endpoint will be interpreted based on the parameters supplied. Depending on which, the request may alternatively be interpreted as a single-date statistics request, date-span statistics request, or pixel-value request.
Get the raster for given product, composite, and date. Currently only the tiff format is supported.
Parameters:
| name | description |
|---|---|
| product | The data product type. See product definition. |
| composite | The type of composite. See composite definition. |
| month | The month of the requested rasters. Must be in yyyymm or yyyy-mm format. |
| format | The raster format. Currently only tiff (or alternatively spelled tif) is supported. Note that this parameter is also required. If not specified or unrecognized type, the request will be interpreted as a (malformed) single-date statistic request. |
Return:
Results will be provided as a zipfile with all rasters contained in the format provided. Zipfiles will be in the filename format:
[platform]_[yyyymm]_[compositetype]_[product].zip
Mosaic rasters are provided in the filename format:
[platform].[yyyyjjj].[mmdd].CA_mosiac.[version].[product].tif
Composite rasters are provided in the filename format:
ts.[start:yyyymmdd]_[end:yyyymmdd].L4.CA_mosiac.[product].[compositetype].tif
Rasters are provided with a color table for symbology. Pixel values are 0-255 and map to the values as indicated in the pixel values table.
Example:
GET: https://fhab-api.sfei.org/chlorophyll/1daymax/202208/tif
Get all observations on August 2022 for the chlorophyll product using the 1-day pixel maximum composite.
Results:
OLCI_202208_1DayMax_chl_gil_rhos.zip
# Single date raster(s) clipped to waterbody
GET: /{product}/{composite}/{date}/{wid}/{format}
POST: /{product} *
*POST requests to this endpoint will be interpreted based on the parameters supplied. Depending on which, the request may alternatively be interpreted as a single-date statistics request, date-span statistics request, or pixel-value request.
Get the raster(s) for given product, composite, and date. Currently only the tiff format is supported.
Parameters:
| name | description |
|---|---|
| product | The data product type. See product definition. |
| composite | The type of composite. See composite definition. |
| date | The date of the requested raster. Must be in yyyymmdd or yyyy-mm-dd format. |
| wid | The waterbody ID for the waterbody to clip the raster to. |
| format | The raster format. Currently only tiff (or alternatively spelled tif) is supported. Note that this parameter is also required. If not specified or unrecognized type, the request will be interpreted as a (malformed) single-date statistic request. |
Return:
The raster will be return in the format provided. If multiple rasters are returned, the file will be served as a zip file. Multiple files may result for mosaic products requests if overflights from both Sentinel-3A and Sentinel-3B are present.
Mosaic rasters are provided in the filename format:
[platform].[yyyymmdd].L3.[product].mosaic.[waterbody-name].tif
Composite rasters are provided in the filename format:
ts.[start:yyyymmdd]_[end:yyyymmdd].L4.[product].[composite].[waterbody-name].tif
Composite rasters will have a date span indicating the start and end dates of the composite window (inclusive). The requested date will correspond to the end date of this window.
Rasters are provided with a color table for symbology. Pixel values are 0-255 and map to the values as indicated in the pixel values table.
Pixel value requests:
# Pixel value
GET: /{product}/{composite}/{date}/lon
GET: /{product}/{composite}/{date}/lat
POST: /{product} *
*POST requests to this endpoint will be interpreted based on the parameters supplied. Depending on which, the request may alternatively be interpreted as a single-date statistics request, date-span statistics request, or raster request.
Get pixel value at a specific longitude and latitude for the given product, composite, and date.
Parameters:
| name | description |
|---|---|
| product | The data product type. See product definition. |
| composite | The type of composite. See composite definition. |
| date | The date from which to grab the pixel values. Must be in yyyymmdd or yyyy-mm-dd format. |
| longitude | The longitude (from -180 to 180). |
| latitude | The latitude (from -90 to 90). |
| format | Optional. The format to return data. Default is json, but csv is also supported. |
Return:
| name | type | description |
|---|---|---|
| [] | object[] | The returned value will be in an array format in case multiple observations were made for the same date. If no valid observations were made (either due to no flyover or pixel coordinates out of bounds of any flyovers), it will be an empty array. |
| [].platform | string | If mosaic data were requested, the platform associated with this observation. |
| [].raw | number | The raw pixel value for this observation at the given coordinates. Note that if raw pixel values are returned, a no-data pixel value may result. (See pixel values table.) |
| [].ci | number | The cyano index value for this observation at the given coordinates. Null for no-data. |
| [].ci_modified | number | The modified cyano index value for this observation at the given coordinates. Null for no-data. |
| [].chl | number | The estimated chlorophyll-a concentration value (mg/m3) for this observation at the given coordinates. Null for no-data. |
| [].pixel | number[] | The pixel bounds of the matched pixel in order: x-min, y-min, x-max, y-max. |
Example:
GET: https://fhab-api.sfei.org/cyano/mosaic/20230621/lon/-122.8387/lat/39.0555/
Get the pixel value using the cyano products and mosaic imagery (no composite) on June 21st, 2023, at the coordinates given by longitude 39.0555 and latitude -122.8387.
Results:
[
{
"platform": "sentinel-3b",
"raw": 220,
"ci": 0.027609365,
"ci_modified": 436.3709835107,
"pixel": [-122.839181,39.054876,-122.835509,39.057392]
},
{
"platform":"sentinel-3a",
"raw": 255,
"ci": null,
"ci_modified": null,
"pixel": [-122.839181,39.054876,-122.835509,39.057392]
}
]
As mosaic data is returned, separate data objects are given for Sentinel-3A and 3B. The above indicates that Sentinel-3B had a flyover of the location in question but Sentinel-3A did not.
# Pixel value histogram
GET: /{product}/{composite}/{wid}/{date}/
POST: /{product}/histogram
Get histogram of pixel values for the given product, composite, waterbody, and date.
Parameters:
| name | description |
|---|---|
| product | The data product type. See product definition. |
| composite | The type of composite. See composite definition. |
| wid | The waterbody ID. |
| date | The date for which to grab pixel values. Must be in yyyymmdd or yyyy-mm-dd format. |
| valuetype | The units for the returned values. See value type definition. |
| format | Optional. The format to return data. Default is json, but csv is also supported. |
Return:
Note that if raw pixel values are returned, high counts for the value 252 may result. This value is the no-data value for land (see pixel values table) and almost always captured as waterbody boundaries are given a two-pixel buffer so as not to potentially exclude any valid pixels. Most of the time, however, it is simply counting pixels in the land mask.
Otherwise (for returns in cyano index, modified cyano index, or chlorophyll), no-data pixels are excluded from the returned data.
| name | type | description |
|---|---|---|
| [] | object[] | The returned value will be in an array format, with each datum representing a bin, in increasing order by bin value. |
| [].platform | string | If mosaic data were requested, the platform associated with this observation. |
| [].value | The bin value. If valuetype was set to raw, no-data pixel values will also be given. (See pixel values table.) Otherwise, no-data values will be excluded from the results. | |
| [].count | The count of pixels with the given bin value. |
Example:
GET: https://fhab-api.sfei.org/cyano/10daymax/33/20231108/histogram/raw/
Compute a histogram of pixel values using the cyano products and 10-day pixel maximum composite on November 8th, 2023. Values are to be reported in raw pixel values.
Results:
[
{
"value": 0,
"count": 1112
},
/* ... */
{
"value": 245,
"count": 1
},
{
"value": 246,
"count": 1
},
{
"value": 247,
"count": 0
},
{
"value": 248,
"count": 0
},
{
"value": 249,
"count": 1
},
{
"value": 250,
"count": 3
},
{
"value": 251,
"count": 0
},
{
"value": 252,
"count": 770
},
{
"value": 253,
"count": 0
},
{
"value": 254,
"count": 0
},
{
"value": 255,
"count": 90
}
]
Note that raw pixel values >250 are no-data values. For more information, see the pixel values table.
Parameter definitions
# Composite
The type of data composite. 1-day and 10-day pixel-max composites are created by compiling all available images over the 1-day and 10-day period and using the maximum observed value at each pixel location in the composite image. Note: 1-day composites have only been processed for the OLCI imagery (those data starting in 2016 onward). It is not currently available for the MERIS datasets.
| name | description |
|---|---|
| 10daymax | A running, 10-day pixel maximum composite. |
| 7daymax | A running, 7-day pixel maximum composite. |
| 1daymax | Single-day pixel maximum composite. |
| mosaic | The un-composited mosaic data, which may be duplicated per day if multiple flyovers (from both Sentinel-3A/B) are present. |
# Platform
The satellite platform which made the observation. Which platform was available depends on the date of the request being made. Note: There exists a significant data gap between 2012 and 2016, after contact was lost with Envisat and before Sentinel-3A become operational.
| name | description |
|---|---|
| envisat | Data captured via MERIS (Medium Resolution Imaging Spectrometer) aboard the Envisat satellite which operated from 2002 to 2012 (when contact was lost). |
| sentinel-3a | Data captured via OLCI (Ocean and Land Color Instrument) on Sentinel-3A, the first of the Sentinel-3 satellites, beginning operation in 2016. |
| sentinel-3b | Data captured via OLCI on Sentinel-3B, the second of the Sentinel-3 satellites, beginning operation in 2018. |
| sentinel-3ab | Starting in 2024, daily imagery from either/both Sentinel-3A and Sentinel-3B were merged. Mosaic data from this platform indicates it was imaged from either of the Sentinel-3 satellites. |
# Product
The data product type, which at current is either cyano index or chlorophyll. Note: Chlorophyll products have only been processed for the OLCI imagery (those data starting in 2016 onward). It is not currently available for the MERIS datasets.
| name | description |
|---|---|
| cicyano | The cyano index product estimates the abundance of cyanobacteria by quantifying the spectral shape at around 680nm, which is affected by the absorption of pigments such as phycocyanin, an accessory pigment in photosynthesis specific to Microcystis sp. |
| cyano | Alias for cicyano. |
| ci | Alias for cicyano. |
| chlorophyll | The Chl-a product estimates the concentration of Chl-a as a proxy for overall biomass based on the RE10 algorithm (Wynne et al., 2022), which examines the ratio of a red-edge band (665nm) to one at near infrared (NIR). |
| chl | Alias for chlorophyll. |
# Statistic
The statistical measure. Supported types listed below. In most use cases, multiple types may be provided, separated by commas.
| name | description |
|---|---|
| max | Maximum value. |
| min | Minimum value. |
| mean | Mean value. |
| median | Median value. |
| perc90 | 90th percentile value. |
# Value type
The units for the return data. Note that some units are only applicable to a specific product type.
| name | description |
|---|---|
| raw | Raw, unconverted pixel values which are 8-bit, unsigned integers ranging from 0-255. No-data values are included (see pixel values table). |
| ci | Pixel values converted to cyano index, which has a range of 0.00006-0.06. Values are unitless by can be related to estimated Microcystis sp. cell concentration (in cells/mL) by a multiplier of 100,000,000. |
| ci_modified | Pixel values converted to cyano index and a multiplier of 15,805.18, which adjusts the value range to 1-1,000. |
| chl | Pixel values converted to estimated Chl-a concentration in micrograms per liter (equivalent to milligrams per cubic meter) and range from 0.05 -134.6 μg/L. |