OpenET API
AccountUser Interface
  • Welcome
  • Quick Start
  • Retrieve API Key
  • Reference
    • API Reference
      • Account
      • Geodatabase
      • Raster
  • Additional Resources
    • Quota
    • Earth Engine
    • Data Availability
    • FARMS
    • Change Log
    • FAQ
    • Tutorial Videos
  • Contact
  • TERMS OF SERVICE
Powered by GitBook
On this page
  1. Reference
  2. API Reference

Geodatabase

Pre-computed field data retrieval.

Last updated 10 months ago

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.

Take a look at how you might call this method:

curl -o field_identifiers.json.zip -L -X 'POST' \
  'https://openet-api.org/geodatabase/metadata/ids' \
  -H 'accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "geometry": [
    -121.67364,
    38.61593,
    -121.67364,
    38.65611,
    -121.65401,
    38.65611,
    -121.65401,
    38.61593
  ]
}'
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:

  • Field ID

  • Area in hectares

  • Date last modified

This endpoint will return properties from multiple states at a time.

Take a look at how you might call this method:

curl -o metadata.json.zip -L -X 'POST' \
  'https://openet-api.org/geodatabase/metadata/properties' \
  -H 'accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "field_ids": [
    "06183913",
    "06208981"
  ]
}'
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).

Take a look at how you might call this method:

curl -o timeseries.json.zip -L -X 'POST' \
  'https://openet-api.org/geodatabase/timeseries' \
  -H 'accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "date_range": [
    "2020-01-01",
    "2020-12-31"
  ],
  "interval": "monthly",
  "field_ids": [
    "06183913",
    "06208981"
  ],
  "models": [
    "Ensemble"
  ],
  "variables": [
    "ET"
  ],
  "file_format": "JSON"
}'
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

Take a look at how you might call this method:

curl -o openet.geojson.zip -L -X 'POST' \
  'https://openet-api.org/geodatabase/metadata/boundaries' \
  -H 'accept: application/json' \
  -H 'Authorization: YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "field_ids": [
    "06183913",
    "06208981"
  ]
}'
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)

USDA crop type code by available year

Allows the user to define a list of OpenET field ids and export a subset of the OpenET geodatabase geometries as an formatted GeoJSON file. This endpoint will return boundaries from multiple states at a time.

CDL
RFC 7946
post

Provides support for retrieving field ids in a region from OpenET's pre-computed database.

Authorizations
Body

Geodatabase metadata properties model class.

field_idsstring[]Required
Responses
200
Successful Response
application/json
Responseany
422
Validation Error
application/json

No content

post

Provides support for retrieving timeseries from OpenET's pre-computed database.

Authorizations
Body

Geodatabase timeseries fields model class.

date_rangestring ยท date[]Required
intervalstringRequired
field_idsstring[]Required
modelsstring[]Required
variablesstring[]Required
file_formatstringRequired
Responses
200
Successful Response
application/json
Responseany
422
Validation Error
application/json

No content

post

Provides support for retrieving field geometries from OpenET's pre-computed database.

Authorizations
Body

Geodatabase metadata boundaries model class.

field_idsstring[]Required
Responses
200
Successful Response
application/json
Responseany
422
Validation Error
application/json

No content

  • Field IDs
  • Field Properties
  • POST/geodatabase/metadata/properties
  • Timeseries by Field ID
  • POST/geodatabase/timeseries
  • Field Boundaries
  • POST/geodatabase/metadata/boundaries
Field boundary retrieval example
Page cover image