Fieldprint API – /v5/FieldData/PrefillCropIntervals
Access to the Fieldprint Platform and API requires Field to Market membership and an active Data Management Licensing Agreement. Learn more about membership and our data partner program to get started. Access to the Fieldprint API requires an authorized API key issued by Field to Market.
The PrefillCropIntervals endpoint generates complete, production-ready crop intervals with default management activities based on customizable input parameters. This endpoint is ideal when you need detailed field data for one or more specific years rather than a complete multi-year history.
Unlike the /v5/FieldData/PrefillFieldHistory endpoint (which generates all years from 2008 to present based primarily on USDA Cropland Data Layer data), the single interval prefill gives you control over key production characteristics for each year you specify.
Endpoint Details
| Endpoint | POST https://api.fieldtomarket.org/v5/FieldData/PrefillCropIntervals |
|---|---|
| Authentication | API Key (provided by Field to Market) |
| Content-Type | application/json |
| Response Format | JSON |
Use Cases
Use this endpoint when you need to:
- Build multi-year histories with different characteristics for each year
- Generate complete management activities for specific crop years where you have partial production data
- Create scenarios with known crop types, yields, or management practices
- Prefill data for years where farmers have provided some information but not complete field records
Request Body
The request body is a JSON object containing a field object with the field boundary geometry and an array of one or more crop_intervals, each specifying the crop and year along with optional management parameters.
Field Object
| Field | Type | Required | Description |
|---|---|---|---|
field.geometry |
GeoJSON Polygon | Yes | Field boundary as a GeoJSON Polygon with coordinates in decimal degrees (longitude, latitude). Used to derive state, county, field size, and soil characteristics. |
field.state |
string | No | US state abbreviation (e.g., "IA"). Derived from geometry if not provided. |
field.county |
string | No | County name. Derived from geometry if not provided. Must be a valid county in the specified state. |
Crop Intervals Array
Each object in the crop_intervals array represents a single crop year with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
crop_id |
string | Yes | The Fieldprint crop identifier (e.g., "10401" for Corn, Grain). See the /v5/ReferenceData/Crops endpoint for a full list of supported crop IDs. |
harvest_year |
integer | Yes | The year the crop was harvested (e.g., 2023). |
is_irrigated |
boolean | No | Whether the crop was irrigated. When true, irrigation activities with default water sources, volumes, and application methods are generated. |
cover_crop |
boolean | No | Whether a cover crop was used. When true, planting and termination activities for a cover crop are generated. |
yield |
object | No | Crop yield with value (number) and unit (string). Accepted units depend on the crop — volume-based (e.g., "bu / acre") or weight-based (e.g., "ton / acre"). If omitted, a regional default yield is used. |
tillage_class_id |
string | No | Tillage intensity classification. Determines the number and type of tillage passes generated. If omitted, a regional default is derived from state and year. See accepted values below. |
total_n |
object | No | Total nitrogen applied, with value (number) and unit ("lb / acre"). If omitted, a default based on crop type and regional norms is used. |
is_planting_interval |
boolean | No | Indicates whether this is a planting interval. Affects planting activity generation. |
Tillage Class Options
| tillage_class_id | Description |
|---|---|
"1" |
No-Till — 85% Residue |
"2" |
Strip-Till — 70% Residue |
"4" |
Reduced Till — 30% Residue |
"6" |
Conventional Till — <10% Residue |
tillage_class_id is not provided, the API automatically derives a regional tillage default based on the state and harvest year. The number of tillage operation passes in the response varies by tillage class — conventional tillage generates more passes than no-till.
Example Request
POST https://api.fieldtomarket.org/v5/FieldData/PrefillCropIntervals Content-Type: application/json Authorization: Bearer {your_api_key} { "field": { "geometry": { "type": "Polygon", "coordinates": [ [ [-95.53909487338437, 42.92811105124366], [-95.53909487338437, 42.92643775409019], [-95.53795761676207, 42.92643775409019], [-95.53795761676207, 42.92811105124366], [-95.53909487338437, 42.92811105124366] ] ] } }, "crop_intervals": [ { "crop_id": "10401", "harvest_year": 2023, "is_irrigated": true, "cover_crop": true, "yield": { "value": 125, "unit": "ton / acre" }, "tillage_class_id": "6", "total_n": { "value": 200.0, "unit": "lb / acre" } } ] }
Example Response
The response returns the enriched field data (with calculated size, state, and county) and complete crop intervals with all generated management activities.
{
"field": {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-95.53909487, 42.92811105],
[-95.53909487, 42.92643775],
[-95.53795762, 42.92643775],
[-95.53795762, 42.92811105],
[-95.53909487, 42.92811105]
]
]
},
"size": { "value": 4.2667242, "unit": "acre" },
"state": "IA",
"county": "O'Brien County"
},
"crop_intervals": [
{
"harvest_year": 2023,
"crop_id": "10401",
"tillage_class_id": "6",
"activities": [
{
"type": "planting_cash",
"date": "2023-05-06",
"inputs": {
"planting_operation_id": "22917",
"seeding_rate": { "value": 30.0, "unit": "lb / acre" },
"diesel_use": { "value": 0.64, "unit": "gal_diesel / acre" },
"seed_treatment": true,
"inoculant_applied": false
}
},
{
"type": "planting_cover",
"date": "2022-11-15",
"inputs": {
"cover_crop_id": "30770",
"planting_operation_id": "22952",
"diesel_use": { "value": 0.1283, "unit": "gal_diesel / acre" },
"termination_date": "2023-05-01",
"termination_operation_id": "23045"
}
},
{
"type": "irrigation",
"date": "2023-10-04",
"inputs": {
"water_sources": [
{
"water_source_id": "1",
"irrigation_volume": { "value": 12.0, "unit": "acre_inch / acre" },
"application_method_id": "2"
}
]
}
},
{
"type": "harvest",
"date": "2023-10-09",
"inputs": {
"harvest_operation_id": "22819",
"yield": { "value": 125.0, "unit": "ton / acre" },
"diesel_use": { "value": 1.53, "unit": "gal_diesel / acre" },
"transport_fuel_id": "1"
}
},
// Tillage — 3 passes generated for Conventional Till (tillage_class_id "6")
{
"type": "tillage",
"date": "2023-04-06",
"inputs": {
"tillage_operation_id": "23050",
"diesel_use": { "value": 1.5, "unit": "gal_diesel / acre" }
}
},
{
"type": "tillage",
"date": "2023-04-21",
"inputs": {
"tillage_operation_id": "22970",
"diesel_use": { "value": 0.38, "unit": "gal_diesel / acre" }
}
},
{
"type": "tillage",
"date": "2023-04-29",
"inputs": {
"tillage_operation_id": "22988",
"diesel_use": { "value": 0.62, "unit": "gal_diesel / acre" }
}
},
{
"type": "nutrient_commercial",
"date": "2023-05-09",
"inputs": {
"fertilizer_operation_id": "22693",
"diesel_use": { "value": 0.16, "unit": "gal_diesel / acre" },
"fertilizers": [
{
"product_type_id": 21,
"nitrogen": { "value": 200.0, "unit": "lb / acre" },
"phosphorus": { "value": 133.0, "unit": "lb / acre" },
"potassium": { "value": 84.0, "unit": "lb / acre" },
"sulfur": { "value": 16.0, "unit": "lb / acre" },
"slow_release": false,
"inhibitor": false
}
]
}
}
],
"additional_data": {
"soil_test": { "p_soil_test_level_id": "5" },
"rice_water_regime": { "water_regime_id": "1" }
}
}
]
}
Response Structure
Field Object (Response)
| Field | Type | Description |
|---|---|---|
field.geometry |
GeoJSON Polygon | The field boundary geometry (echoed back from input). |
field.size |
object | Calculated field size with value (number) and unit ("acre"). Derived from the geometry. |
field.state |
string | US state abbreviation derived from the field geometry. |
field.county |
string | County name derived from the field geometry. |
Crop Intervals (Response)
Each crop interval in the response includes the harvest_year, crop_id, and resolved tillage_class_id, along with a complete activities array and additional_data.
Activity Types
The activities array contains generated management activities. Each activity has a type, date, and inputs object. The following activity types may be generated depending on the input parameters:
| Activity Type | Generated When | Key Inputs |
|---|---|---|
planting_cash |
Always (for the primary crop) | planting_operation_id, seeding_rate, diesel_use, seed_treatment, inoculant_applied |
planting_cover |
When cover_crop is true |
cover_crop_id, planting_operation_id, diesel_use, termination_date, termination_operation_id |
irrigation |
When is_irrigated is true |
water_sources[] with water_source_id, irrigation_volume, application_method_id |
harvest |
Always | harvest_operation_id, yield, diesel_use, transport_fuel_id |
tillage |
Always (multiple passes based on tillage class) | tillage_operation_id, diesel_use |
nutrient_commercial |
Always | fertilizer_operation_id, diesel_use, fertilizers[] with N/P/K/S values |
Validation & Error Handling
The API validates all input fields and returns structured error responses. Common validation error types include:
| Error Code | Description | Example |
|---|---|---|
REQUIRED |
A required field or combination of fields is missing. | "One of crop_intervals.0.crop_id or options.benchmark_crop_id must be specified" |
CHOICE |
An invalid value was provided for a field with a fixed set of options. | "[VALUE] is not a valid choice in ReferenceData/Crops" |
TYPE |
A field value does not match the expected data type. | "invalid literal for int() with base 10: [VALUE]" |
UNITS |
The unit provided does not match what the field expects. | "Units are [UNITS], but should be lb / acre" |
GEOMETRY |
The GeoJSON geometry is invalid or out of range. | "Geometry not a Polygon or MultiPolygon" or "Location out of range for US soils database" |
STRUCTURE |
The JSON structure is malformed. | "Expecting property name enclosed in double quotes" |
DEPRECATED |
A deprecated field name was used in the request. | "json.Rotation.0.crop_id" (use crop_intervals[].crop_id instead) |
Example: Invalid Crop ID
{
"crop_intervals": {
"0": {
"crop_id": [
{
"message": "\"99999\" is not a valid choice in ReferenceData/Crops",
"code": "CHOICE"
}
]
}
}
}
Example: Missing Geometry
{
"field": {
"geometry": [
{
"message": "Missing geometry",
"code": "GEOMETRY"
}
]
}
}
Example: Invalid Units for Yield
{
"crop_intervals": {
"0": {
"yield": [
{
"message": "Units are [UNITS], but should be one of: [volume]/ac, [weight]/ac",
"code": "UNITS"
}
]
}
}
}
Usage Notes
PrefillCropIntervals) when you have specific crop and year information to supply. Use /v5/FieldData/PrefillFieldHistory when you want the full USDA CDL-based history from 2008 to present generated automatically.
crop_intervals array. Each interval can have different crop types, years, and management parameters.
tillage_class_id is derived from state-level tillage survey data for the harvest year, and yield defaults to county-level average yields for the crop.
"bu / acre", while forage crops use "ton / acre". Use the /v5/ReferenceData/Crops endpoint to determine the appropriate yield unit for a given crop. Submitting incorrect units will return a UNITS validation error.
Related Endpoints
| Endpoint | Description |
|---|---|
/v5/FieldData/PrefillFieldHistory |
Generate a complete multi-year crop history (2008–present) from USDA Cropland Data Layer data. |
/v5/ReferenceData/Crops |
List all supported crop IDs and their metadata. |
/v5/ReferenceData/TillageClasses |
List tillage class options with residue percentages. |
/v5/Calculator |
Submit crop interval data and calculate Fieldprint metric results. |
/v5/ScaledBenchmarks |
Get scaled sustainability scores (0–100) with state and national benchmarks. |
Reach out to support@fieldtomarket.org with additional questions on implementation.