curl 'https://www.wiseyield.co/api/v1/farms/11111111.../yield-prediction?cropType=wheat&plantedArea=50&season=winter' \
-H "Authorization: Bearer $WISEYIELD_API_KEY"
const params = new URLSearchParams({ cropType: 'wheat', plantedArea: '50', season: 'winter' });
const res = await fetch(
`https://www.wiseyield.co/api/v1/farms/${farmId}/yield-prediction?${params}`,
{ headers: { Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}` } }
);
const { data: prediction } = await res.json();
console.log('Predicted yield:', prediction.predictedYield, 'tons');
console.log('95% CI:', prediction.confidenceIntervals.p5, '-', prediction.confidenceIntervals.p95);
import os, requests
res = requests.get(
f'https://www.wiseyield.co/api/v1/farms/{farm_id}/yield-prediction',
params={'cropType': 'wheat', 'plantedArea': 50, 'season': 'winter'},
headers={'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}"},
)
prediction = res.json()['data']
{
"data": {
"predictedYield": 123,
"confidenceIntervals": {
"p5": 123,
"p50": 123,
"p95": 123
},
"trainingSampleSize": 123,
"modelConfidence": "<string>",
"trustBadge": "<string>"
}
}Analytics
Get yield prediction
ML-based yield forecast with confidence intervals, trained on the farm’s harvest history.
GET
/
api
/
v1
/
farms
/
{id}
/
yield-prediction
curl 'https://www.wiseyield.co/api/v1/farms/11111111.../yield-prediction?cropType=wheat&plantedArea=50&season=winter' \
-H "Authorization: Bearer $WISEYIELD_API_KEY"
const params = new URLSearchParams({ cropType: 'wheat', plantedArea: '50', season: 'winter' });
const res = await fetch(
`https://www.wiseyield.co/api/v1/farms/${farmId}/yield-prediction?${params}`,
{ headers: { Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}` } }
);
const { data: prediction } = await res.json();
console.log('Predicted yield:', prediction.predictedYield, 'tons');
console.log('95% CI:', prediction.confidenceIntervals.p5, '-', prediction.confidenceIntervals.p95);
import os, requests
res = requests.get(
f'https://www.wiseyield.co/api/v1/farms/{farm_id}/yield-prediction',
params={'cropType': 'wheat', 'plantedArea': 50, 'season': 'winter'},
headers={'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}"},
)
prediction = res.json()['data']
{
"data": {
"predictedYield": 123,
"confidenceIntervals": {
"p5": 123,
"p50": 123,
"p95": 123
},
"trainingSampleSize": 123,
"modelConfidence": "<string>",
"trustBadge": "<string>"
}
}GET https://www.wiseyield.co/api/v1/farms/{id}/yield-prediction
Authentication
Requires a key with theanalytics:read scope.
Path parameters
string
required
Farm UUID.
Query parameters
string
required
Crop name (e.g.
wheat, date palm).number
required
Positive number in the farm’s
areaUnit.string
Optional variety name (improves prediction accuracy when historical data exists for the same variety).
string
default:"year_round"
winter, summer, autumn, spring, year_round.string
Optional field UUID. When provided, the model uses the field’s soil characteristics (overrides farm-level defaults).
Response
object
Show Prediction
Show Prediction
number
Expected yield in tons.
object
integer
Number of historical crops used to train the model.
string
high · moderate · low — derived from sample size, soil-data completeness, and variance.string
data-driven when the model had sufficient historical data + soil inputs; data-assisted when partial; ai-generated when the model fell back to defaults. See Trust badges.curl 'https://www.wiseyield.co/api/v1/farms/11111111.../yield-prediction?cropType=wheat&plantedArea=50&season=winter' \
-H "Authorization: Bearer $WISEYIELD_API_KEY"
const params = new URLSearchParams({ cropType: 'wheat', plantedArea: '50', season: 'winter' });
const res = await fetch(
`https://www.wiseyield.co/api/v1/farms/${farmId}/yield-prediction?${params}`,
{ headers: { Authorization: `Bearer ${process.env.WISEYIELD_API_KEY}` } }
);
const { data: prediction } = await res.json();
console.log('Predicted yield:', prediction.predictedYield, 'tons');
console.log('95% CI:', prediction.confidenceIntervals.p5, '-', prediction.confidenceIntervals.p95);
import os, requests
res = requests.get(
f'https://www.wiseyield.co/api/v1/farms/{farm_id}/yield-prediction',
params={'cropType': 'wheat', 'plantedArea': 50, 'season': 'winter'},
headers={'Authorization': f"Bearer {os.environ['WISEYIELD_API_KEY']}"},
)
prediction = res.json()['data']
Errors
| Status | When |
|---|---|
400 VALIDATION_ERROR | Missing cropType or plantedArea, or plantedArea not positive |
400 INVALID_ID | {id} or fieldId is not a valid UUID |
401 | Missing, malformed, expired, or revoked API key |
403 INSUFFICIENT_SCOPE | Key lacks analytics:read scope |
404 NOT_FOUND | Farm doesn’t exist or belongs to another user |
429 RATE_LIMIT_EXCEEDED | Per-user rate limit reached |
5xx | Server error |
Notes
- The model needs at least 3 historical harvested/failed crops of the same
cropTypefordata-drivenaccuracy. Fewer historical crops drops thetrustBadgetodata-assistedorai-generated. - See Trust badges for the integrity contract.