Calculating using the CFT

This topic guide explains how to send data to the CFT’s calculation modules.

Note

All URLs start with /api/v1/.

Crop assessment

POST /crop_product/calculate/

Calculate emissions for a crop product, without saving it to the database

Example request

POST /crop_product/calculate/ HTTP/1.1
Host: app.coolfarmtool.org
Accept: application/json
Content-Type: application/json
[
  {
    "farm": {
      "country": "United States of America",
      "territory": "Alabama",
      "climate": "temperate",
      "average_temperature": {
        "value": 15,
        "unit": "°C"
      },
      "farm_identifier": ""
    },
    "crop": {
      "type": "Potato",
      "feed_type": null,
      "field_size": {
        "value": 100,
        "unit": "ha"
      },
      "soil": {
        "texture_id": 1,
        "organic_matter_id": 2,
        "moisture_id": 1,
        "drainage_id": 1,
        "ph_id": 4,
        "organic_matter_custom": null
      },
      "product_fresh": {
        "value": 1000,
        "unit": "tonne"
      },
      "product_finished": {
        "value": 990,
        "unit": "tonne"
      },
      "residue": {
        "value": null,
        "unit": null,
        "management": "Left distributed on field, OR incorporated, OR mulched"
      },
      "seed_amount": {
        "value": 10,
        "unit": "tonne"
      }
    },
    "pesticides": [
      {
        "applications": 1,
        "category_id": 3,
        "percentage_rate": 100,
        "application_rate": {
          "value": 1,
          "unit": "kg / acre"
        }
      }
    ],
    "fertilisers": [
      {
        "type": "Compose your own NPK",
        "production": "Europe 2014",
        "custom_ingredients": {
          "n_total_percentage": 0.0,
          "n_ammonia_percentage": 0.0,
          "n_nitric_percentage": 0.0,
          "n_urea_percentage": 0.0,
          "p2o5_percentage": 0.0,
          "p2o5_percentage_type_id": 4,
          "k2o_percentage": 0.0,
          "k2o_percentage_type_id": 5
        },
        "application_rate": {
          "value": 15,
          "unit": "kg / ha"
        },
        "rate_measure": "product",
        "method": 2,
        "inhibition_id": 1,
        "added_within_20_years": false,
        "years_ago": null,
        "allocation": null
      }
    ],
    "machinery": [
      {
        "operations": 1,
        "machinery": 24,
        "fuel_type": "diesel"
      }
    ],
    "irrigation": [
      {
        "method": 1,
        "water_source": 1,
        "allocation": 100,
        "pumping_depth": {
          "value": 1,
          "unit": "m"
        },
        "horizontal_distance": {
          "value": 2,
          "unit": "km"
        },
        "water_added": {
          "value": 2,
          "unit": "ha-mm"
        },
        "power_source": 1
      }
    ],
    "direct_energy": [
      {
        "category": "irrigation",
        "source": "diesel",
        "usage": {
          "value": 1000,
          "unit": "litre"
        }
      }
    ],
    "land_management": [
      {
        "change_id": 10,
        "years_ago": 1,
        "allocation": 100,
        "forest": {
          "type": "temperate oceanic forest",
          "age_years": 1
        }
      }
    ],
    "transport": [
      {
        "mode": "road LGV diesel (light goods vehicle <3.5t)",
        "weight": {
          "value": 4,
          "unit": "tonne"
        },
        "distance": {
          "value": 2000,
          "unit": "km"
        }
      }
    ],
    "tree_biomass": [
      {
        "tree_type": 5,
        "density_last_year": {
          "value": 100,
          "unit": "trees / hectare"
        },
        "size_last_year": {
          "value": 10,
          "unit": "cm"
        },
        "size_this_year": {
          "value": 15,
          "unit": "cm"
        },
        "num_trees_delta": {
          "value": 1,
          "unit": "trees / hectare"
        }
      }
    ],
    "co_products": [
      {
        "name": "test_co_product",
        "percentage_main_value": 50
      }
    ],
    "processing": [
      {
        "_type": 1,
        "allocation": 100,
        "power_source": 102
      }
    ],
    "storage": [
      {
        "cipc_application": 1,
        "cipc_dose": 1,
        "storage_power_source": 106,
        "store_loading_power_source": 102,
        "unloading_power_source": 102,
        "stored_allocation": 100,
        "temperature": {
          "unit": "°C",
          "value": 5
        },
        "time": {
          "unit": 46,
          "value": 1
        }
      }
    ]
  }
]

Example response

HTTP/1.1 200 OK
Content-Type: application/json
[
    {
        "farm": {
            "farm_identifier": ""
        },
        "summary": {
            "emissions_total": [
                "-399588.13",
                "kg CO2e"
            ],
            "emissions_per_area": [
                "-3982.69",
                "kg CO2e / ha"
            ],
            "emissions_per_product": [
                "-402.29",
                "kg CO2e / tonne"
            ],
            "soil_organic_carbon": "2.00%",
            "machinery_fuel_usage": "140.00 litre"
        },
        "total_emissions": [
            {
                "name": "co_product",
                "CO2": "-199794.06",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "-199794.06",
                "total_CO2e_per_area": "-1997.94",
                "total_CO2e_per_product": "-201.81"
            },
            {
                "name": "fertiliser_production",
                "CO2": "67.35",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "67.35",
                "total_CO2e_per_area": "0.67",
                "total_CO2e_per_product": "0.07"
            },
            {
                "name": "fertiliser_soil",
                "CO2": "0.00",
                "N2O": "23.80",
                "CH4": "0.00",
                "total_CO2e": "6305.84",
                "total_CO2e_per_area": "63.06",
                "total_CO2e_per_product": "6.37"
            },
            {
                "name": "field_energy",
                "CO2": "0.00",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "0.00",
                "total_CO2e_per_area": "0.00",
                "total_CO2e_per_product": "0.00"
            },
            {
                "name": "irrigation",
                "CO2": "1790.09",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "1790.09",
                "total_CO2e_per_area": "17.90",
                "total_CO2e_per_product": "1.81"
            },
            {
                "name": "machinery",
                "CO2": "250.13",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "250.13",
                "total_CO2e_per_area": "2.50",
                "total_CO2e_per_product": "0.25"
            },
            {
                "name": "management_changes",
                "CO2": "-415427.91",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "-415427.91",
                "total_CO2e_per_area": "-4154.28",
                "total_CO2e_per_product": "-419.62"
            },
            {
                "name": "pesticide",
                "CO2": "1366.67",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "1366.67",
                "total_CO2e_per_area": "13.67",
                "total_CO2e_per_product": "1.38"
            },
            {
                "name": "processing",
                "CO2": "5.77",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "5.77",
                "total_CO2e_per_area": "0.06",
                "total_CO2e_per_product": "0.01"
            },
            {
                "name": "residue",
                "CO2": "0.00",
                "N2O": "18.60",
                "CH4": "0.00",
                "total_CO2e": "4929.71",
                "total_CO2e_per_area": "49.30",
                "total_CO2e_per_product": "4.98"
            },
            {
                "name": "seed",
                "CO2": "-3956.32",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "-3956.32",
                "total_CO2e_per_area": "-39.56",
                "total_CO2e_per_product": "-4.00"
            },
            {
                "name": "storage",
                "CO2": "3269.87",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "3269.87",
                "total_CO2e_per_area": "32.70",
                "total_CO2e_per_product": "3.30"
            },
            {
                "name": "transportation",
                "CO2": "1810.67",
                "N2O": "0.00",
                "CH4": "0.00",
                "total_CO2e": "1810.67",
                "total_CO2e_per_area": "18.11",
                "total_CO2e_per_product": "1.83"
            }
        ]
    }
]
Request Headers
Status Codes

Dairy assessment

POST /dairy_product/calculate/

Calculate emissions for a dairy product, without saving it to the database

Example request

POST /dairy_product/calculate/ HTTP/1.1
Host: app.coolfarmtool.org
Accept: application/json
Content-Type: application/json
[
  {
    "farm": {
      "country": 840,
      "territory": "Wisconsin",
      "climate": "temperate",
      "average_temperature": {
        "value": 15,
        "unit": "°C"
      },
      "farm_identifier": ""
    },
    "general": {
      "grazing_area": {
        "value": 50,
        "unit": "ha"
      },
      "feed_approach": "dmi",
      "fertilisation_approach": 1
    },
    "milk_production": {
      "variety": "Normande",
      "reporting_year": 2019,
      "date_time": "start",
      "date_month": 1,
      "name": "normande_2019",
      "product_dry": {
        "value": 500000,
        "unit": "litre"
      },
      "fat_content": 4.2,
      "protein_content": 3.5,
      "protein_measure": 1
    },
    "herd_sections": [
      {
        "phase": "Dairy calves",
        "animals": 40,
        "live_weight": {
          "value": 166,
          "unit": "kg"
        },
        "sold_animals": 15,
        "sold_weight": {
          "value": 166,
          "unit": "kg"
        },
        "purchased_animals": 10,
        "purchased_weight": {
          "value": 166,
          "unit": "kg"
        }
      },
      {
        "phase": "Meat calves",
        "animals": 30,
        "live_weight": {
          "value": 230,
          "unit": "kg"
        },
        "sold_animals": 10,
        "sold_weight": {
          "value": 230,
          "unit": "kg"
        },
        "purchased_animals": 5,
        "purchased_weight": {
          "value": 230,
          "unit": "kg"
        }
      },
      {
        "phase": "Milk cows",
        "animals": 100,
        "live_weight": {
          "value": 555,
          "unit": "kg"
        },
        "sold_animals": 5,
        "sold_weight": {
          "value": 555,
          "unit": "kg"
        },
        "purchased_animals": 0,
        "purchased_weight": {
          "value": 555,
          "unit": "kg"
        }
      }
    ],
    "grazing": [
      {
        "herd_section": "Dairy calves",
        "days": 100,
        "hours": 12,
        "category": 2,
        "quality": 1
      },
      {
        "herd_section": "Meat calves",
        "days": 100,
        "hours": 12,
        "category": 3,
        "quality": 2
      },
      {
        "herd_section": "Milk cows",
        "days": 150,
        "hours": 12,
        "category": 2,
        "quality": 1
      }
    ],
    "fertilisers": [
      {
        "type": "Ammonium nitrate - 33.5% N (prilled)",
        "production": "Europe 2014",
        "custom_ingredients": {},
        "application_rate": {
          "value": 30,
          "unit": "kg / ha"
        },
        "rate_measure": ""
      },
      {
        "type": "Compose your own NPK",
        "production": "Europe 2014",
        "custom_ingredients": {
          "n_ammonia_percentage": 6,
          "n_total_percentage": 12,
          "n_nitric_percentage": 4,
          "n_urea_percentage": 2,
          "p2o5_percentage": 8,
          "p2o5_percentage_type_id": 4,
          "k2o_percentage": 4,
          "k2o_percentage_type_id": 5
        },
        "application_rate": {
          "value": 20,
          "unit": "kg / ha"
        },
        "rate_measure": ""
      }
    ],
    "feed_components": [
      {
        "herd_section": "Dairy calves",
        "item": "Grass fresh managed - on farm",
        "dry_matter": {
          "value": 0.41,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Dairy calves",
        "item": "Maize / corn grain",
        "dry_matter": {
          "value": 10,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Dairy calves",
        "item": "Oats",
        "dry_matter": {
          "value": 4,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Dairy calves",
        "crop_product": {
          "type": "Soyabean",
          "slug": null,
          "product_dry": {
            "value": 5,
            "unit": "tonne"
          },
          "feed_type": "Soybean",
          "emissions_total": {
            "value": 22469.393582158074,
            "unit": "kg CO2e"
          }
        },
        "dry_matter": {
          "value": 10,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Dairy calves",
        "item": "Compound dairy feed: Belgium (65% soy)",
        "dry_matter": {
          "value": 5,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Meat calves",
        "item": "Grass fresh managed - on farm",
        "dry_matter": {
          "value": 0.62,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Meat calves",
        "item": "Maize / corn grain",
        "dry_matter": {
          "value": 5,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Meat calves",
        "crop_product": {
          "type": "Soyabean",
          "product_dry": {
            "value": 5,
            "unit": "tonne"
          },
          "feed_type": "Soybean",
          "emissions_total": {
            "value": 22469.393582158074,
            "unit": "kg CO2e"
          }
        },
        "dry_matter": {
          "value": 8,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Meat calves",
        "item": "Soybean cake/meal",
        "dry_matter": {
          "value": 5,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Milk cows",
        "item": "Straw",
        "dry_matter": {
          "value": 10,
          "unit": "kg"
        },
        "certified": false
      },
      {
        "herd_section": "Milk cows",
        "crop_product": {
          "type": "Soyabean",
          "product_dry": {
            "value": 5,
            "unit": "tonne"
          },
          "feed_type": "Soybean",
          "emissions_total": {
            "value": 22469.393582158074,
            "unit": "kg CO2e"
          }
        },
        "dry_matter": {
          "value": 5,
          "unit": "kg"
        },
        "certified": false
      }
    ],
    "manure": [
      {
        "herd_section": "Dairy calves",
        "type": "Solid storage",
        "allocation": 100
      },
      {
        "herd_section": "Milk cows",
        "type": "Aerobic treatment - natural aeration",
        "allocation": 100
      }
    ],
    "bedding": [
      {
        "type": 621,
        "quantity": {
          "value": 100,
          "unit": "kg"
        }
      }
    ],
    "direct_energy": [
      {
        "source": "diesel",
        "usage": {
          "value": 1200,
          "unit": "litre"
        },
        "category": 1
      },
      {
        "source": "electricity (grid)",
        "usage": {
          "value": 1000,
          "unit": "kWh"
        },
        "category": 1
      }
    ],
    "transport": [
      {
        "mode": "road LGV diesel (light goods vehicle <3.5t)",
        "weight": {
          "value": 5,
          "unit": "tonne"
        },
        "distance": {
          "value": 3500,
          "unit": "km"
        }
      }
    ]
  }
]

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "total_emissions": [
    {
      "CH4": "0.00",
      "CO2": "1344.73",
      "N2O": "0.00",
      "name": "energy",
      "total_CO2e": "1344.73"
    },
    {
      "CH4": "2267.14",
      "CO2": "0.00",
      "N2O": "0.00",
      "name": "enteric",
      "total_CO2e": "56678.61"
    },
    {
      "CH4": "0.00",
      "CO2": "26461.58",
      "N2O": "0.00",
      "name": "feed",
      "total_CO2e": "26461.58"
    },
    {
      "CH4": "0.00",
      "CO2": "6939.96",
      "N2O": "0.00",
      "name": "grazing",
      "total_CO2e": "6939.96"
    },
    {
      "CH4": "0.00",
      "CO2": "10480.26",
      "N2O": "0.00",
      "name": "manure",
      "total_CO2e": "10480.26"
    },
    {
      "CH4": "0.00",
      "CO2": "2716.00",
      "N2O": "0.00",
      "name": "transport",
      "total_CO2e": "2716.00"
    }
  ],
  "summary": {
    "emissions_total": [
      "100560.4049907536020612299397",
      "kg CO2e"
    ]
  }
}
Request Headers
Status Codes

Feed

The Cool farm tool allows 2 types of format for the feed section.

Feed approach 1: Dry Matter Intake (if you know the DMI values)

{
  "general": {
     "grazing_area": {
         "value": 60,
         "unit": "ha"
     },
     "feed_approach": "dmi"
  },
  "feed_components": [
    {
      "herd_section": "Dairy calves",
      "item": "Oats",
      "dry_matter": {
        "value": 10,
        "unit": "kg"
      },
      "certified": false
    },
    {
      "herd_section": "Meat calves",
      "item": "Grass fresh managed - on farm",
      "dry_matter": {
        "value": 1.37,
        "unit": "kg"
      },
      "certified": false
    },
    {
      "herd_section": "Meat calves",
      "item": "Maize / corn grain",
      "dry_matter": {
        "value": 5,
        "unit": "kg"
      },
      "certified": false
    },
    {
      "herd_section": "Milk cows",
      "item": "Sorghum",
      "dry_matter": {
        "value": 15,
        "unit": "kg"
      },
      "certified": false
    }
  ]
}

Feed approach 2: Average feed (the tool will estimate the DMI)

{
  "general": {
     "grazing_area": {
         "value": 60,
         "unit": "ha"
     },
     "feed_approach": "average"
  },
  "feed_components": [
    {
      "item": "Oat hay",
      "certified": 60
    },
    {
      "item": "Straw",
      "percentage": 40
    }
  ]
}

Calculate a crop assessment first

You can also use the crop API to first calculate a crop assessment that then can be used as a feed item within the Dairy API for both feed approach 1 and 2. See calculate a crop assessment.

You will need to choose an existing feed item to use as the base for manure and enteric fermentation properties.

List of the available feed types

Example for feed approach 1

{
  "feed_components": [
    {
      "herd_section": "Meat calves",
      "crop_product": {
        "type": "Soyabean",
        "product_dry": {
          "value": 5,
          "unit": "tonne"
        },
        "feed_type": "Soybean",
        "emissions_total": {
          "value": 22469.393582158074,
          "unit": "kg CO2e"
        }
      },
      "dry_matter": {
        "value": 5,
        "unit": "kg"
      },
      "certified": false
    }
  ]
}

Example for feed approach 2

{
  "feed_components": [
    {
      "item": "Oat hay",
      "percentage": 60
    },
    {
      "crop_product": {
        "type": "Maize",
        "product_dry": {
          "value": 2,
          "unit": "tonne"
        },
        "feed_type": "Maize silage",
        "emissions_total": {
          "value": 267.5460271629662,
          "unit": "kg CO2e"
        }
      },
      "percentage": 40
    }
  ]
}

JSON export

From the web interface on a crop or dairy assessment, you can generate a JSON file compatible with the API. This can be used to test and debug the API. To find the JSON export functionality, go to the ‘more’ page of an assessment.

Water assessment

POST /crop_product/water/calculate/

Calculate water assessment for a crop, without saving it to the database

Example request

POST /crop_product/water/calculate/ HTTP/1.1
Host: app.coolfarmtool.org
Accept: application/json
Content-Type: application/json
[
    {
        "farm": {
            "country": "Spain",
            "territory": "Madrid",
            "climate": "temperate",
            "average_temperature": {
                "value": 15,
                "unit": "°C"
            },
            "farm_identifier": "my_identifier",
            "latitude": 40.417,
            "longitude": -3.704
        },
        "crop": {
            "type": "Potato",
            "field_size": {
                "value": 51,
                "unit": "ha"
            },
            "product_fresh": {
                "value": 3000,
                "unit": "tonne"
            },
            "product_dry": {
                "value": 3000,
                "unit": "tonne"
            },
            "reporting_year": 2016,
            "planting_date": {
                "time": 1,
                "month": 1,
                "year": 2016
            },
            "harvest_date": {
                "time": 1,
                "month": 3
            },
            "name": "potato_2016",
            "soil": {
                "label": "sandy wet",
                "type": "sandy_clay",
                "moisture_at_sowing": "wet"
            }
        },
        "irrigation": {
            "irri_start_date": {
                "time": 1,
                "month": 1,
                "year": 2016
            },
            "irri_end_date": {
                "time": 1,
                "month": 2,
                "year": 2016
            },
            "method": 2,
            "water_source": 1,
            "irrigation_events": [
                {
                    "water_added": {
                        "value": 20.78,
                        "unit": "mm"
                    },
                    "allocation": 100,
                    "has_source_pump": false,
                    "water_source": 3
                },
                {
                    "water_added": {
                        "value": 27.3,
                        "unit": "mm"
                    },
                    "allocation": 100
                },
                {
                    "water_added": {
                        "value": 23.55,
                        "unit": "mm"
                    },
                    "allocation": 100
                },
                {
                    "water_added": {
                        "value": 25,
                        "unit": "mm"
                    },
                    "allocation": 100
                },
                {
                    "water_added": {
                        "value": 21,
                        "unit": "mm"
                    },
                    "allocation": 100
                }
            ]
        }
    }
]

Example response

HTTP/1.1 200 OK
Content-Type: application/json
[
    {
        "farm": {
            "farm_identifier": "my_identifier"
        },
        "summary": {
            "water_productivity": {
                "value": 93.3,
                "unit": "kg / m3"
            },
            "water_footprint": {
                "value": 10.72,
                "unit": "litre / kg",
                "green": 7.22,
                "blue": 3.5
            },
            "irrigation_efficiency": {
                "value": 1.87,
                "unit": "litre / litre"
            },
            "water_balance": {
                "unit": "mm",
                "water_requirement": {
                    "total_value": 63.05,
                    "weekly": [
                        3.75,
                        5.31,
                        6.35,
                        6.58,
                        7.85,
                        5.15,
                        11.82,
                        9.04,
                        7.2
                    ]
                },
                "water_added": {
                    "rainfall": {
                        "total_value": 93.35,
                        "weekly": [
                            21.69,
                            4.94,
                            0.0,
                            1.55,
                            4.55,
                            28.47,
                            4.85,
                            25.76,
                            1.54
                        ]
                    },
                    "irrigation": {
                        "total_value": 117.63,
                        "weekly": [
                            20.78,
                            27.3,
                            23.55,
                            25.0,
                            21.0
                        ]
                    }
                },
                "irrigation_percolation": -70.85,
                "irrigation_runoff": -26.19,
                "rainfall_runoff": -18.44,
                "rainfall_percolation": -40.07,
                "irrigation_balance": 20.5,
                "interception_losses": -12.88
            }
        }
    }
]
Request Headers
Status Codes

Irrigation events

Calculating the number of weeks between irrigation dates

To enter the correct number of irrigation events follow the formula below to calculate the correct number of weeks/irrigation events between the irrigation start date and irrigation end date.

Number of days between irrigation start date and irrigation end date (knowing that “start” = 5th, “middle” = 15th and “end” = 25th day of the month and last day not included) divided by 7 and rounded to the highest integer number. See the example below:

  • irrigation start date: start April 2016 -> 2016-04-05

  • irrigation end date: middle May 2016 -> 2016-05-15

  • days between: 40

  • 40 / 7 = 5.71428 -> So rounded to highest integer is 6 weeks

Water source

To select an irrigation water source enter the “water_source” key under the irrigation key. This value will be used as the default for all irrigation events.

In order to enter a different water source for a specific irrigation event just add two fields to override the default value as per the example below:

{
     "water_added": {
        "value": 12000,
        "unit": "litre"
    },
    "allocation": 100,
    "has_source_pump": false,
    "water_source": 3
}

Energy only

POST /energy/calculate/

Calculate the energy content of the specified fuel usage

Form Parameters
  • int factor – emissions factor (source) ID; see GET /energy/

  • float usage – consumption

  • int unit – unit ID

Example request

POST /energy/calculate/ HTTP/1.1
Host: app.coolfarmtool.org
Accept: application/json
Content-Type: application/json

factor=102&usage=1000&unit=15

Example response

HTTP/1.1 200 OK
Content-Type: application/json

37900.0
Request Headers
Status Codes

Fertiliser only

POST /fertiliser/calculate/

Calculate the nutrient content of specified fertiliser application

Form Parameters
  • int fertiliser_type – fertiliser type ID; see GET /fertiliser/

  • float rate – rate

  • int unit – unit ID; must be convertible to kg / ha, see GET /unit/

Example request

POST /fertiliser/calculate/ HTTP/1.1
Host: app.coolfarmtool.org
Accept: application/json
Content-Type: application/json

fertiliser_type=1&rate=16&unit=24

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{"n": [2.88, "kg / ha"]}
Request Headers
Status Codes

Irrigation only

POST /irrigation/calculate/

Calculate the volume of water applied

Form Parameters
  • float depth – depth of irrigation

  • int depth_unit – unit ID; must be convertible to m, see GET /unit/

  • float area – area irrigated

  • int area_unit – unit ID; must be convertible to ha, see GET /unit/

Example request

POST /irrigation/calculate/ HTTP/1.1
Host: app.coolfarmtool.org
Accept: application/json
Content-Type: application/json

depth=10&depth_unit=3&area=10&area_unit=56

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{"rate": 1}
Request Headers
Status Codes