Get Models

This API provides the list of available models in the aWhere platform. Today a variety of crop growth stage models are generally available, with many more on the way.

Each models applies to particular crops from the Crops API, and after an initial review of the available models, you can often save the model ID and simply reference the details and results as needed.

On This Page...

API Request

API Endpoints

HTTP Verbs and URIs

GET /v2/agronomics/models
  • Returns a list of available models in the platform.
  • Use query string parameters to filter the list (see below).
GET /v2/agronomics/models/{modelId}
  • Retrieves a specific model.

Parameters

Parameter Description Valid Values
{modelId} The ID of the model you wish to reference. Model IDs are strings provided by the aWhere APIs. A string

Query String Parameters

Query Parameter Name Description Valid Values
limit The number of results to include on each of page of listed models. Used in conjunction with offset to paginate.

Applies only to the Models List.
An integer number up to 120
offset The number of objects to skip before returning objects. Used in conjunction with offset to paginate. For example, if limit=50 and offset=50, then the API will be returning the second page of results.

Applies only to the Models List.
An integer up to the total number of results.
sort List of results can be sorted by any of the properties shown at right. See Sorting Conventions for more information.

Applies only to the Models List.
name
type
properties Only include these properties in the response. If not specified, then all properties are included by default. Any properties not specified are always included. name
description
type
source
crop Filter the list of models to only those that apply to a certain crop. The API will return models that apply to any crop ID classified by that name; if you only want models that apply to a specific crop record, use the next parameter. Any value found in the name property of the Crops API, such as "corn," "wheat," etc.
cropId Filter the list of models to only those that apply to a specific crop record. Any valid crop ID from the Crops API.

Request Body

None

HTTP Headers

Remember to always send your OAuth2 Access Token in the Authorization header (see Authentication). This API doesn't require any additional headers.

API Response

Response HTTP Status Codes and Headers

This API returns standard HTTP status codes and headers for aWhere APIs. Additionally, the Models List will return Content-Range header which is another way to know how many results are being shown and the total number of results. It looks like this:

Content-Range: {start}-{end}/{total} models

Response Body

Format for the Models List

{
 "models":[{
    "id": "{id}",
    "name":"{name}",
    "description":"{description}",
    "type":"{type}",
    "source":{
        "name":"{sourceName}",
        "link":"{sourceLink}",
        },
    "_links":{ 
        "self":{"href":"{modelSelfLink}"
        "curies":[{
            "name":"awhere",
            "href":"http://awhere.com/rels/{rel}",
            "templated":true
            }],
        "awhere:crop":[
            { "href":"{cropLink}" },
            { "href":"{cropLink}" },
            { "href":"{cropLink}" },
            { ...       }
            ], 
        "awhere:modelDetails":{ "href":"{modelDetailsLink}"}
        }
    },{ 
          ...
        }
     ],
 "_links":{
    "self":{"href":"{listSelfLink}"},
}
}

Format for a Single Model

{
"id": "{id}",
"name":"{name}",
"description":"{description}",
"type":"{type}",
"source":{
    "name":"{sourceName}",
    "link":"{sourceLink}",
    },
"_links":{ 
    "self":{"href":"{modelSelfLink}"
    "curies":[{
        "name":"awhere",
        "href":"http://awhere.com/rels/{rel}",
        "templated":true
        }],
    "awhere:crop":[
        { "href":"{cropLink}" },
        { "href":"{cropLink}" },
        { "href":"{cropLink}" },
        { ...       }
        ], 
    "awhere:modelDetails":{ "href":"{modelDetailsLink}"}
    }
}

Property Descriptions

Name Description
{id} The Model ID. Use this to reference the model in other APIs.
{name} The model name, which could be shown in a dropdown box or list.
{description} A description of the model.
{type} The model type, for example: growthstage.
{sourceName}
and
{sourceLink}
The original source of a model and a link to the source's website or the original literature. All models in the platform are vetted by our agronomic scientists regardless of the original source.
{modelSelfLink} The URI of the each model object.
{cropLink} The URI of each crop record for which the model applies.
{modelDetailsLink} The URI of the Details API for each model. For growth stage models this is the defined stages and GDD thresholds.
{next_page} The URI used to get the next page of results, using the same limit used for this request (default is 50). If there are no more results this property is not included.
{previous_page} The URI used to get the previous page of results, using the same limit used for this request (default is 50). If you're at the beginning of the list this property is not included.