# Geodatabase

{% hint style="info" %}
**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](/docs/reference/api-reference/raster.md) endpoints.&#x20;
{% endhint %}

{% hint style="success" %}
**Special:** due to the ability to retrieve large amounts of data, geodatabase query results are compressed as .zip files.&#x20;
{% endhint %}

## 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.

<figure><img src="/files/or5URBpmx5wo6qati2DS" alt="" width="375"><figcaption><p>Field boundary retrieval example</p></figcaption></figure>

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.&#x20;

As of December 2025, field IDs are formatted as 11-digit numerical codes. Old field IDs containing FIPS code prefixes are obsolete for OpenET API services but may still be retrieved by specifying `version` as `2.0`.

## Field Ids

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

```json
{"openapi":"3.1.0","info":{"title":"OpenET API","version":"3.0.0"},"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"Field_Ids":{"properties":{"geometry":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"format":"[longitude, latitude, ...]","title":"Geometry"},"asset_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"EE Shapefile Table ID","remember":"Share with openet@googlegroups.com"},"version":{"type":"number","title":"Geodatabase version","default":2.1}},"type":"object","title":"Field_Ids","description":"Geodatabase metadata field ids model class."},"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"}}},"paths":{"/geodatabase/metadata/ids":{"post":{"tags":["Retrieve Pre-computed Field Data"],"summary":"Field Ids","description":"Provides support for retrieving field ids in a region from OpenET's pre-computed database.","operationId":"field_ids_geodatabase_metadata_ids_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Field_Ids"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

Take a look at how you might call this method:

{% tabs %}
{% tab title="curl" %}

```bash
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
  ]
}'
```

{% endtab %}

{% tab title="Python" %}

```python
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
  ],
  # For old field ID format:
  # "version": 2.0,
}

# 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)
```

{% endtab %}
{% endtabs %}

## 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
* USDA [CDL](https://developers.google.com/earth-engine/datasets/catalog/USDA_NASS_CDL#bands) crop type code by available year
* Date last modified

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

## Field Properties

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

```json
{"openapi":"3.1.0","info":{"title":"OpenET API","version":"3.0.0"},"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"Properties":{"properties":{"field_ids":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"OpenET Field IDs"}},"type":"object","required":["field_ids"],"title":"Properties","description":"Geodatabase metadata properties model class."},"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"}}},"paths":{"/geodatabase/metadata/properties":{"post":{"tags":["Retrieve Pre-computed Field Data"],"summary":"Field Properties","description":"Provides support for retrieving field ids in a region from OpenET's pre-computed database.","operationId":"field_properties_geodatabase_metadata_properties_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Properties"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

Take a look at how you might call this method:

{% tabs %}
{% tab title="curl" %}

```bash
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"
  ],
  "version": 2.1,
}'
```

{% endtab %}

{% tab title="Python" %}

```python
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)
```

{% endtab %}
{% endtabs %}

## 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. &#x20;

For large queries, uncompressed `csv` output is not an option and `json` must be selected.&#x20;

{% hint style="success" %}
**Note**: data in geodatabase are stored in metric *(mm & hectares)*.
{% endhint %}

## Fields

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

```json
{"openapi":"3.1.0","info":{"title":"OpenET API","version":"3.0.0"},"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"Fields_TS":{"properties":{"date_range":{"items":{"type":"string","format":"date"},"type":"array","format":"[YYYY-MM-DD, YYYY-MM-DD]","title":"Time Range"},"interval":{"type":"string","title":"Interval","options":["monthly"]},"field_ids":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"OpenET Field IDs"},"models":{"items":{"type":"string"},"type":"array","title":"OpenET Models","options":["disalexi","eemetric","ensemble","geesebal","ptjpl","sims","ssebop"]},"variables":{"items":{"type":"string"},"type":"array","title":"Variables","options":["et","eto","etof","et_mad_max","et_mad_min","ndvi","pr"]},"file_format":{"type":"string","title":"Output Extension","options":["csv","json"]}},"type":"object","required":["date_range","interval","field_ids","models","variables","file_format"],"title":"Fields_TS","description":"Geodatabase timeseries fields model class."},"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"}}},"paths":{"/geodatabase/timeseries":{"post":{"tags":["Retrieve Pre-computed Field Data"],"summary":"Fields","description":"Provides support for retrieving timeseries from OpenET's pre-computed database.","operationId":"fields_geodatabase_timeseries_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Fields_TS"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

Take a look at how you might call this method:

{% tabs %}
{% tab title="curl" %}

```bash
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"
}'
```

{% endtab %}

{% tab title="Python" %}

```python
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)
```

{% endtab %}
{% endtabs %}

## 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](https://geojson.org/) formatted `GeoJSON` file. This endpoint will return boundaries from multiple states at a time.

## Boundaries

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

```json
{"openapi":"3.1.0","info":{"title":"OpenET API","version":"3.0.0"},"security":[{"APIKeyHeader":[]}],"components":{"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"Boundaries":{"properties":{"field_ids":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"OpenET Field IDs"}},"type":"object","required":["field_ids"],"title":"Boundaries","description":"Geodatabase metadata boundaries model class."},"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"}}},"paths":{"/geodatabase/metadata/boundaries":{"post":{"tags":["Retrieve Pre-computed Field Data"],"summary":"Boundaries","description":"Provides support for retrieving field geometries from OpenET's pre-computed database.","operationId":"boundaries_geodatabase_metadata_boundaries_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Boundaries"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}}}
```

Take a look at how you might call this method:

{% tabs %}
{% tab title="curl" %}

```bash
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"
  ]
}'
```

{% endtab %}

{% tab title="Python" %}

```python
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)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://openet.gitbook.io/docs/reference/api-reference/geodatabase.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
