Note: data for the prior month is typically populated by the 5th of the current month. To retrieve the latest data, check out the Raster endpoints.
Special: due to the ability to retrieve large amounts of data, geodatabase query results are compressed as .zip files.
Field IDs
Supports queries against OpenET's geodatabase to retrieve a list of field ids within a polygon specified by a list of longitude latitude pairs. Data is returned as a List. If the boundary of the polygon intersects a field, its unique id will be included as shown in the example below where the user provided boundary is the red rectangle. Each field id of the blue fields is included.
Note, if asset_id is used in place of geometry, only the bounds of the asset geometry are considered. This means a single polygon is created and used. Single polygon asset is recommend here to avoid unexpected results.
import gzip
import requests
# set your API key before making the request
header = {"Authorization": YOUR_API_KEY}
# endpoint arguments
args = {
"geometry": [
-121.67364,
38.61593,
-121.67364,
38.65611,
-121.65401,
38.65611,
-121.65401,
38.61593
]
}
# query the api
resp = requests.post(
headers=header,
json=args,
url="https://openet-api.org/geodatabase/metadata/ids"
)
# unzip the data
data = eval(gzip.decompress(resp.content).decode())
print(data)
Field Properties
Supports queries against OpenET's geodatabase to retrieve metadata properties from a list of field ids. Metadata attributes include:
import gzip
import requests
# set your API key before making the request
header = {"Authorization": YOUR_API_KEY}
# endpoint arguments
args = {
"field_ids": [
"06183913",
"06208981"
]
}
# query the api
resp = requests.post(
headers=header,
json=args,
url="https://openet-api.org/geodatabase/metadata/properties"
)
# unzip the data
data = eval(gzip.decompress(resp.content).decode())
print(data)
Timeseries by Field ID
Allows the user to define a list of field ids and export a subset of the OpenET geodatabase to retrieve timeseries data. Extractions will only include data within one US State at a time, however, multi-model and variable queries are supported in list format.
For large queries, uncompressed csv output is not an option and json must be selected.
Note: data in geodatabase are stored in metric (mm & hectares).
import gzip
import requests
# set your API key before making the request
header = {"Authorization": YOUR_API_KEY}
# endpoint arguments
args = {
"date_range": [
"2020-01-01",
"2020-12-31"
],
"interval": "monthly",
"field_ids": [
"06183913",
"06208981"
],
"models": [
"Ensemble"
],
"variables": [
"ET"
],
"file_format": "JSON"
}
# query the api
resp = requests.post(
headers=header,
json=args,
url="https://openet-api.org/geodatabase/timeseries"
)
# unzip the data
data = eval(gzip.decompress(resp.content).decode())
print(data)
Field Boundaries
Allows the user to define a list of OpenET field ids and export a subset of the OpenET geodatabase geometries as an RFC 7946 formatted GeoJSON file. This endpoint will return boundaries from multiple states at a time.
import gzip
import requests
# set your API key before making the request
header = {"Authorization": YOUR_API_KEY}
# endpoint arguments
args = {
"field_ids": [
"06183913",
"06208981"
]
}
# query the api
resp = requests.post(
headers=header,
json=args,
url="https://openet-api.org/geodatabase/metadata/boundaries"
)
# unzip the data
data = eval(gzip.decompress(resp.content).decode())
print(data)
Field boundary retrieval example
Provides support for retrieving field ids in a region
from OpenET's pre-computed database.
post
/geodatabase/metadata/properties
Authorizations
Body
field_idsstring[]required
Responses
application/json
application/json
200
422
No body
Provides support for retrieving timeseries from OpenET's
pre-computed database.
post
/geodatabase/timeseries
Authorizations
Body
intervalstringrequired
file_formatstringrequired
date_rangestring · date[]required
field_idsstring[]required
modelsstring[]required
variablesstring[]required
Responses
application/json
application/json
200
422
No body
Provides support for retrieving field geometries from OpenET's
pre-computed database.