ClimateSmart API Documentation

This API provides functionality to run, check, and send data to a farm system.

1. GET /api/run/{farm}

Description: Run a simulation for a specified farm.

Path Parameter:

Requests:

Request example:

curl http://climatesmart.variwise.com/api/run/{farm}
or use a browser with address http://climatesmart.variwise.com/api/run/{farm}

Response:

{
  "success": true,
  "message": "Task has been submitted."
}

2. GET /api/check/{farm}

Description: Check the status of a specific farm.

Path Parameter:

Requests:

Request example:

curl http://climatesmart.variwise.com/api/check/{farm}
or use a browser with address http://climatesmart.variwise.com/api/check/{farm}

Response:

{
  "success": true,
  "message": {simulation result for the farm in CSV format}
}

3. POST /api/met/{farm}

Description: Submit a plain text file with meteorological data to a specified farm.

Path Parameter:

Request Body:

Plain text file content (e.g., weather data)
    

Request example:

curl -X POST http://climatesmart.variwise.com/api/met/{farm}  -H "Content-Type: text/plain"  --data-binary @oakey_aero.met

Response:

{
  "success": true,
  "message": "file saved to {farm}"
}

4. POST /api/input/{farm}

Description: Send an input plain text file to a specific farm.

Path Parameter:

Request Body:

Plain text file content (e.g., operational input)
    

Request example:

curl -X POST http://climatesmart.variwise.com/api/input/{farm}  -H "Content-Type: text/plain"  --data-binary @inputsims.txt

Response:

{
  "success": true,
  "message": "file saved to {farm}"
}

5. GET /api/stations

Description: Get a list of weather stations

Request example:

curl http://climatesmart.variwise.com/api/stations
or use a browser with address http://climatesmart.variwise.com/api/stations

Response:

        [{"id": 266, "name": "Atlas"},
        {"id": 298, "name": "Bland Sand AWS"},
        {"id": 437, "name": "Brogo Farm"},
        {"id": 532, "name": "CEFN Wyemo"},
        {"id": 355, "name": "Drury Condabri Feedlot"},
        {"id": 30, "name": "Ginkgo"},
        {"id": 703, "name": "Goondiwindi"},
        {"id": 171, "name": "Indulkana Marla"},
        {"id": 569, "name": "Minderoo Exmouth"},
        {"id": 247, "name": "Mt Stirling"},
        {"id": 393, "name": "RTK South Mobile 2"},
        {"id": 552, "name": "BSoilco Nowra"},
        {"id": 180, "name": "Stanthorpe Big Thermometer"},
        {"id": 138, "name": "TC Blackham"},
        {"id": 137, "name": "TC The Farm"},
        {"id": 327, "name": "TCC Hermit Park Depot 1st Ave"},
        {"id": 611, "name": "TCC Horseshoe Bay"},
        {"id": 612, "name": "TCC Oak Valley"},
        {"id": 330, "name": "ATCC Parkland Rd Alligator Creektlas"},
        {"id": 328, "name": "TCC Rangewood Drive Entrance"},
        {"id": 329, "name": "TCC Rowes Bay Depot"},
        {"id": 411, "name": "UNITAS Annandale Farm"},
        {"id": 271, "name": "UNITAS Clear Springs Dairy"},
        {"id": 175, "name": "UNITAS Elliott Research"},
        {"id": 287, "name": "UNITAS Forester Lodge Dairy"},
        {"id": 456, "name": "UNITAS Forthside Research"},
        {"id": 368, "name": "UNITAS Glenwood Dairy ARCHIVED"},
        {"id": 369, "name": "UNITAS Lileah Dairy"},
        {"id": 174, "name": "UNITAS Montana Dairy"},
        {"id": 374, "name": "UNITAS Thirlstane Dairy"},
        {"id": 377, "name": "UNITAS Woodrising Dairy"},
        {"id": 100, "name": "USQ Burdekin"},
        {"id": 70, "name": "USQ Dalby"},
        {"id": 148, "name": "USQ Toowoomba Ag Plot"},
        {"id": 55, "name": "USQ Waverley"},
        {"id": 500, "name": "USQ Yargullen"},
        {"id": 334, "name": "Wilderness One"},
        {"id": 388, "name": "Wyoming Mayrung"}]
    

6. GET /api/weather/{farm}/{station id}

Description: Download the current day weather data file in csv format. Save a copy to farm/simulations folder as weather.csv

Path Parameter:

Request example:

curl http://climatesmart.variwise.com/api/weather/{farm}/{station id}
or use a browser with address http://climatesmart.variwise.com/api/weather/{farm}/{station id}

Response:

        The csv file will be downloaded or an error message.