Seed Rate
Agriculture Math & Calculations Credits / request: 1Calculates seed quantity from area and crop defaults or row spacing.
GET
https://api.apikodu.com/api/v1/agriculture/seedrate
Documentation
Overview
Seed amount (kg). User rate, spacing formula or table default.
Authentication
Every request requires the x-api-key header. Credits used and remaining quota are returned in response headers (x-api-credits-used, x-api-remaining-credits, x-rate-limit-*).
Request
GET
https://api.apikodu.com/api/v1/agriculture/seedrate?area=50&areaUnit=da&crop=wheat
Query string.
Parameters
| Name | Type | Required | Default | Options | Description |
|---|---|---|---|---|---|
area |
number | * Required | — | — | Area. |
areaUnit |
string | Optional | da |
da dekar donum ha are m2 |
Area unit. |
crop |
string | Optional | — | wheat barley maize sunflower cotton potato tomato rapeseed oats rye sugarbeet grape apple chickpea lentil |
Crop code. Required without rate/spacing. |
seedKgPerDecare |
number | Optional | — | — | User kg/da. |
rowSpacingCm |
number | Optional | — | — | Row spacing cm. |
plantSpacingCm |
number | Optional | — | — | Plant spacing cm. |
germinationPercent |
number | Optional | — | — | Germination %. |
thousandSeedWeight |
number | Optional | — | — | Thousand seed weight g. |
Response
| Name | Type | Description |
|---|---|---|
seedKg |
number | Total seed kg = seedKgPerDecare × areaDecares. |
seedKgPerDecare |
number | Seed kg per decare. User rate, spacing formula or table default. |
plantsPerM2 |
number | Plants per m² for the spacing formula. Null for other formulas. |
areaDecares |
number | Area in decares (da). 1 da = 1000 m². |
crop |
string | Normalized crop code. Null if omitted. |
formula |
string | user-rate: seedKgPerDecare was set. spacing: row/plant spacing. table-default: crop table. |
method |
string | Calculation method. seedrate for this API. |
source |
string | user: dailyTemps or et0Mm. db: tarim_hava cell. |
disclaimer |
string | Decision-support disclaimer. Not agronomic advice or a prescription. |
Errors
| HTTP | code | Description |
|---|---|---|
400 |
-252 |
area missing/≤0 or areaUnit is invalid. |
400 |
-250 |
crop is required (without rate/spacing) or crop is unknown. |
400 |
-249 |
seedKgPerDecare is negative, or none of rate/spacing/table default is available. |
401 |
-100 |
x-api-key is missing, empty, malformed, inactive, banned, expired, IP-restricted, or not allowed for this API. |
429 |
-221 |
Per-minute request limit exceeded. Response headers: x-rate-limit-limit, x-rate-limit-remaining, x-rate-limit-reset. |
429 |
— | Package credit quota cannot cover this request. Body may be { error, limit, currentUsage, requestCost } (no code field). |
500 |
-1 |
Unexpected server error. message is a generic error text without technical details. |
Notes
- Success body is { data: { ... } }. Error body is { code, message }. code is an ApiResponseCode enum value (negative integer).
Sample response
{
"data": {
"seedKg": 1000.0,
"seedKgPerDecare": 20.0,
"plantsPerM2": null,
"areaDecares": 50.0,
"crop": "wheat",
"formula": "table-default",
"method": "seedrate",
"source": "user",
"disclaimer": "Decision support only. Not agronomic advice."
}
}
Code samples
const response = await fetch('https://api.apikodu.com/api/v1/agriculture/seedrate', {
method: 'GET',
headers: {
'x-api-key': 'YOUR_API_KEY'
}
});
const data = await response.json();
console.log(data);
import requests
headers = {
'x-api-key': 'YOUR_API_KEY'
}
response = requests.get('https://api.apikodu.com/api/v1/agriculture/seedrate', headers=headers)
print(response.json())
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
var response = await client.GetStringAsync("https://api.apikodu.com/api/v1/agriculture/seedrate");
Console.WriteLine(response);
$response = file_get_contents('https://api.apikodu.com/api/v1/agriculture/seedrate', false, stream_context_create([
'http' => [
'header' => "x-api-key: YOUR_API_KEY"
]
]));
print_r(json_decode($response, true));
curl -X GET 'https://api.apikodu.com/api/v1/agriculture/seedrate' \
-H 'x-api-key: YOUR_API_KEY'
Start building in minutes
Create a free account, get your API key and send your first request in minutes.