Spray Mix
Agriculture Math & Calculations Credits / request: 1Area × dose × water arithmetic. Not a pesticide prescription.
GET
https://api.apikodu.com/api/v1/agriculture/spraymix
Documentation
Overview
Spray mix amount and tank count. Not a prescription.
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/spraymix?area=50&areaUnit=da&dosePerDecare=0.2&doseUnit=l&tankLiter=400
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. |
dosePerDecare |
number | * Required | — | — | Dose per decare. |
doseUnit |
string | Optional | l |
l kg |
Dose unit. |
crop |
string | Optional | — | wheat barley maize sunflower cotton potato tomato rapeseed oats rye sugarbeet grape apple chickpea lentil |
Crop code (informational). |
waterLiterPerDecare |
number | Optional | — | — | Water L per decare. |
tankLiter |
number | Optional | — | — | Tank volume L. |
Response
| Name | Type | Description |
|---|---|---|
productAmount |
number | Total product amount. Unit is doseUnit (l or kg). |
doseUnit |
string | Product unit: l or kg. |
waterLiter |
number | Total water litres = waterLiterPerDecare × areaDecares. |
tankCount |
integer | Tank count when tankLiter is set (rounded up). Null otherwise. |
areaDecares |
number | Area in decares (da). 1 da = 1000 m². |
crop |
string | Normalized crop code. Null if omitted. |
method |
string | Calculation method. area-dose-water 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 |
-253 |
doseUnit is not l or kg. |
400 |
-249 |
dosePerDecare missing/negative, waterLiterPerDecare negative, or tankLiter ≤ 0. |
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": {
"productAmount": 10.0,
"doseUnit": "l",
"waterLiter": 1000.0,
"tankCount": 3,
"areaDecares": 50.0,
"crop": "wheat",
"method": "area-dose-water",
"source": "user",
"disclaimer": "Decision support only. Not agronomic advice."
}
}
Code samples
const response = await fetch('https://api.apikodu.com/api/v1/agriculture/spraymix', {
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/spraymix', 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/spraymix");
Console.WriteLine(response);
$response = file_get_contents('https://api.apikodu.com/api/v1/agriculture/spraymix', 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/spraymix' \
-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.