API
Api root.
AOI Manager
Create AOI
- POST /aoi_manager/create_aoi
- Request Headers:
Authorization – OAuth token to authenticate
- Form Parameters:
user_id (string) – DDC user ID
name (string) – Name of the AOI
geometry (string) – Geometry in WKT format
start_date (string) – Start date of in the data in YYYY-MM-DD format
end_date (string) – End date of in the data in YYYY-MM-DD format
is_dynamic (boolean) – activate dynamic data collecting if set to true
data_layers (object) – Data layer object
Example request:
POST /aoi_manager/create_aoi HTTP/1.1 Host: api.cropomservices.com Accept: application/json
Example POST body:
{ "user_id": "<client_id>", "name": "dev-test-99", "geometry": "MultiPolygon (((18.08560969551235331 46.86772107489328221, 18.0809319229929919 46.87207063933603735, 18.08074953278025632 46.87263906395731539, 18.09645389890026124 46.88074515547633325, 18.10174586493670645 46.87578912739379433, 18.08560969551235331 46.86772107489328221)))", "start_date": "2020-01-01", "end_date": "2023-05-17", "is_dynamic": "true", "data_layers": { "data_sources": [ {"title": "Sentinel-2", "name": "S2L2A", "bands": []}, {"title": "Meteorology", "name": "Meteorology", "bands": ["Temp Min", "Temp Max", "Temp Avg", "ET0", "Prec"]}, {"title": "Soil", "name": "Soil", "bands": []}, {"title": "Daily Vegetation Phenology and Productivity", "name": "HR_VPP_DAILY", "bands": []}, {"title": "10-daily Seasonal Trajectories", "name": "HR_VPP_ST", "bands": []}, {"title": "Sentinel-1 GRD", "name": "S1GRD", "bands": []}, {"title": "Nhrl", "name": "Nhrl", "bands": ["nhrl"]}, {"title": "Sentinel-2 Planetary Computer", "name": "S2L2A_PC", "bands": ["B04", "B08"]} ] } }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: application/json { "id": 17231, "user_id": "<client_id>", "name": "dev-test-99", "data_layers": { "data_sources": [ { "title": "Sentinel-2", "name": "S2L2A", "bands": [] }, { "title": "Meteorology", "name": "Meteorology", "bands": [ "Temp Min", "Temp Max", "Temp Avg", "ET0", "Prec" ] }, { "title": "Soil", "name": "Soil", "bands": [] }, { "title": "Daily Vegetation Phenology and Productivity", "name": "HR_VPP_DAILY", "bands": [] }, { "title": "10-daily Seasonal Trajectories", "name": "HR_VPP_ST", "bands": [] }, { "title": "Sentinel-1 GRD", "name": "S1GRD", "bands": [] }, { "title": "Nhrl", "name": "Nhrl", "bands": [ "nhrl" ] }, { "title": "Sentinel-2 Planetary Computer", "name": "S2L2A_PC", "bands": [ "B04", "B08" ] } ] }, "geometry": "MultiPolygon (((18.08560969551235331 46.86772107489328221, 18.0809319229929919 46.87207063933603735, 18.08074953278025632 46.87263906395731539, 18.09645389890026124 46.88074515547633325, 18.10174586493670645 46.87578912739379433, 18.08560969551235331 46.86772107489328221)))", "is_dynamic": "true", "start_date": "2020-01-01", "end_date": "2023-05-17", "zarr_id": "17231_auth0|6333f4972b827f142d3d418e.zarr" }
Get AOI
- GET /aoi_manager/get_aoi?user_id=(client_id)
Example request:
GET /aoi_manager/get_aoi?user_id=(client_id) HTTP/1.1 Host: api.cropomservices.com
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript [ { "user_id": "<client_id>", "id": 1, "name": "RACE_kukorica_26", "area": "70.18", "is_dynamic": false, "created_at": "2023-09-04 13:12:23", "start_date": "2019-03-27", "end_date": "2019-11-21", "status": "ready", "zarr_id": "1_<client_id>.zarr" }, { "user_id": "<client_id>", "id": 2, "name": "RACE_kukorica_26", "area": "70.18", "is_dynamic": false, "created_at": "2023-09-04 13:14:35", "start_date": "2019-03-27", "end_date": "2019-11-21", "status": "ready", "zarr_id": "1_<client_id>.zarr" } ]
- Request Headers:
Authorization – OAuth token to authenticate
Crop Model
Run model
- GET /crop_model/run
- Request Headers:
Authorization – OAuth token to authenticate
- Parameters:
user_id – (string) DDC user ID.
aoi_id – (int) AOI ID to refere a Data Cube.
growing_season_id – (int) ID of Growing Season. If this parameter is given, than no need of crop_model_name and date parameters, as they are recorded already to the Growing Season.
start_date – (date in YYYY-MM-DD format) Start date of model run.
end_date – (date in YYYY-MM-DD format) End date of model run.
sowing_date – (date in YYYY-MM-DD format) Crop sowing date. It hase to be inside the interva defined by start_date and end_date.
soil_type – (string) Soil type definition according to the USDA triangle.
crop_model_name – (string) Name of phenological model describing a crop type.
init_water_content – (int) % value of soil water content at the start date. Valid values are 0-100.
seasonal_trajectory – (boolean) If set to True the model utilizes the Phenology curve of plant growing measured by satellite.
irrigation – (string) Irrigation schedule. Defining the irrigation activity by date and water output (value) in mm. Format: ((YYYY-MM-DD,value),…,(YYYY-MM-DD,value))
Example request:
GET /crop_model/run?user_id=(client_id)&aoi_id=(aoi_id)&start_date=2022-04-01&end_date=2022-11-30&sowing_date=2022-04-01&init_water_content=30&crop_model_name=MaizeGDD&seasonal_trajectory=true&soil_type=SiltLoam HTTP/1.1 Host: api.cropomservices.com
Crop
Endpoints to interact with the Crops.
Crop Type
- GET /crop/get_type
- Request Headers:
Authorization – OAuth token to authenticate
- Parameters:
user_id – (string) DDC user ID.
Example request:
GET /crop/get_type?user_id=(user_id) HTTP/1.1 Host: api.cropomservices.com Accept: application/json
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript [ { "id": 2, "name": "Corn" }, { "id": 3, "name": "Winter wheat" } ]
- POST /crop/create_type
- Form Parameters:
user_id (string) – DDC user ID.
crop_type_name (string) – Name of the crop type.
Example request:
POST /crop/create_type HTTP/1.1 Host: api.cropomservices.com Accept: application/json, text/javascript
Example POST body:
{ "user_id": "<client_id>", "crop_type_name": "Sample Corn" }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "crop_type_id": 1, "crop_type_name": "Sample Corn", "user_id": "<user_id>" }
Crop Variety
- GET /crop/get_variety
- Request Headers:
Authorization – OAuth token to authenticate
- Parameters:
user_id – (string) DDC user ID.
crop_type_id – (int) ID of the crop type.
Example request:
GET /crop/get_variety?user_id=(user_id)&crop_type_id=2 HTTP/1.1 Host: api.cropomservices.com
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript [ { "id": 1, "name": "Variety 1" }, { "id": 2, "name": "Variety 2" }, ]
- POST /crop/create_type
- Form Parameters:
user_id (string) – DDC user ID.
crop_type_id (int) – Crop type ID.
crop_variety_name (string) – Name of the crop variety.
Example request:
POST /crop/create_variety HTTP/1.1 Host: api.cropomservices.com Accept: application/json, text/javascript
Example POST body:
{ "user_id": "<client_id>", "crop_type_id": 3, "crop_variety_name": "Wheat variety 1" }
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "crop_variety_id": 1, "crop_variety_name": "Wheat variety 1", "crop_type_id": 3, "user_id": "<user_id>" }
List available phenological models
- GET /crop/get_model
- Request Headers:
Authorization – OAuth token to authenticate
- Parameters:
user_id – (string) DDC user ID.
crop_type_id – (int) ID of crop type. This parameter is optional. If it is empty all models are listed regardless of crop type.
Example request:
GET /api.cropomservices.com/crop/get_model?user_id=(user_id)&crop_type_id=2 HTTP/1.1 Host: api.cropomservices.com Accept: application/json
Example response:
HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript [ { "id": 7, "name": "Maize" }, { "id": 8, "name": "MaizeGDD" }, { "id": 29, "name": "MaizeChampionGDD" } ]