Hasat Penceresi
Hesaplama Tarım Kredi / istek: 1Ürün GDD hasat eşiğine göre birikim ve tahmini hasat günü. Reçete değildir.
POST
https://api.apikodu.com/api/v1/agriculture/harvestwindow
Dokümantasyon
Genel bakış
Ürün GDD hasat (veya stageCode) eşiğine birikir. Reçete değildir.
Kimlik doğrulama
Her istekte x-api-key başlığı zorunludur. Kullanılan kredi ve kalan kota yanıt başlıklarında (x-api-credits-used, x-api-remaining-credits, x-rate-limit-*) döner.
İstek
POST
https://api.apikodu.com/api/v1/agriculture/harvestwindow
JSON gövde. GET query de var. dailyTemps veya lat/lon.
Parametreler
| Ad | Tip | Zorunlu | Varsayılan | Seçenekler | Açıklama |
|---|---|---|---|---|---|
crop |
string | * Zorunlu | wheat |
wheat barley maize sunflower cotton potato tomato rapeseed oats rye sugarbeet grape apple chickpea lentil |
Ürün kodu. |
fromDate |
string | * Zorunlu | — | — | YYYY-MM-DD |
toDate |
string | Opsiyonel | — | — | YYYY-MM-DD. Boşsa fromDate+365. |
latitude |
number | Opsiyonel | — | — | dailyTemps yoksa gerekir. |
longitude |
number | Opsiyonel | — | — | Boylam. |
stageCode |
string | Opsiyonel | harvest |
emergence flowering harvest |
GDD eşik kodu. Varsayılan harvest. |
includeDaily |
boolean | Opsiyonel | true |
true false |
Günlük GDD. Varsayılan true. |
dailyTemps |
json | Opsiyonel | — | — | [{date,tmin,tmax}]. Varsa lat/lon yok sayılır. |
Yanıt
| Ad | Tip | Açıklama |
|---|---|---|
crop |
string | Normalize ürün. |
stageCode |
string | Kullanılan eşik kodu. |
threshold |
number | Gerekli kümülatif GDD. |
gddCumulative |
number | Biriken GDD. |
reached |
boolean | Eşik aşıldıysa true. |
reachedDate |
string | Eşiğin aşıldığı gün. Yoksa null. |
remainingGdd |
number | Kalan GDD. Aşıldıysa 0. |
estimatedDate |
string | Ortalama günlük GDD ile tahmin. Veri yoksa null. |
fromDate |
string | YYYY-MM-DD. |
toDate |
string | YYYY-MM-DD. |
daysTotal |
integer | Penceredeki takvim günü. |
daysWithData |
integer | GDD hesaplanan gün. |
missingCount |
integer | Eksik gün sayısı. |
missingDates |
array | İlk 10 eksik tarih. |
gridLatitude |
number | 0.1° hücre. |
gridLongitude |
number | 0.1° hücre. |
stages |
array | Ürün GDD eşikleri. |
stages[].code |
string | emergence, flowering, harvest ... |
stages[].threshold |
number | Eşik GDD. |
stages[].reached |
boolean | Aşıldı mı. |
daily |
array | includeDaily=true ise. |
daily[].date |
string | YYYY-MM-DD. |
daily[].tmin |
number | Min °C. |
daily[].tmax |
number | Max °C. |
daily[].gdd |
number | Günlük GDD. |
daily[].gddCumulative |
number | Kümülatif. |
method |
string | gdd-harvest. |
source |
string | database veya user. |
disclaimer |
string | Karar destek uyarısı. |
Hatalar
| HTTP | code | Açıklama |
|---|---|---|
400 |
-250 |
crop yok veya bilinmiyor. |
400 |
-249 |
stageCode bu üründe yok veya gövde boş. |
400 |
-254 |
Tarih aralığı geçersiz. |
400 |
-255 |
dailyTemps veya lat/lon gerekir. |
429 |
-316 |
Firmanın günlük yeni konum (hücre) limiti (50) doldu. Daha önce sorgulanan konumlar çalışmaya devam eder; yeni konum ertesi gün (UTC). Retry-After başlığı gün sonuna kalan saniye. |
503 |
-256 |
Hücre doluyor. |
400 |
-251 |
Hava yok. |
401 |
-100 |
x-api-key yok, boş, prefix/uzunluk hatalı, pasif, yasaklı, süresi dolmuş, IP kısıtına takıldı veya bu API anahtara izinli değil. |
429 |
-221 |
Dakikalık istek limiti aşıldı. Yanıt başlıkları: x-rate-limit-limit, x-rate-limit-remaining, x-rate-limit-reset. |
429 |
— | Paket kredi kotası bu isteğin kredisini karşılamıyor. Gövde { error, limit, currentUsage, requestCost } olabilir (code alanı yok). |
500 |
-1 |
Beklenmeyen sunucu hatası. message genel bir hata metnidir; teknik ayrıntı içermez. |
Notlar
- Başarılı gövde { data: { ... } } şeklindedir. Hata gövdesi { code, message } şeklindedir. code alanı ApiResponseCode enum değeridir (negatif tam sayı).
Örnek yanıt
{
"data": {
"crop": "wheat",
"stageCode": "harvest",
"threshold": 1600.0,
"gddCumulative": 1624.5,
"reached": true,
"reachedDate": "2026-07-18",
"remainingGdd": 0.0,
"estimatedDate": "2026-07-18",
"fromDate": "2026-03-01",
"toDate": "2026-08-31",
"daysTotal": 184,
"daysWithData": 180,
"missingCount": 4,
"missingDates": [
"2026-03-12"
],
"gridLatitude": 39.90,
"gridLongitude": 32.90,
"stages": [
{
"code": "emergence",
"threshold": 120.0,
"reached": true
},
{
"code": "flowering",
"threshold": 800.0,
"reached": true
},
{
"code": "harvest",
"threshold": 1600.0,
"reached": true
}
],
"daily": [
{
"date": "2026-03-01",
"tmin": 2.0,
"tmax": 12.0,
"gdd": 3.0,
"gddCumulative": 3.0
}
],
"method": "gdd-harvest",
"source": "database",
"disclaimer": "Decision support only. Not agronomic advice. Weather data: Copernicus ERA5 / ERA5-Land, Open-Meteo, OpenWeather, MET Norway. Contains modified Copernicus Climate Change Service information."
}
}
Kod örnekleri
const response = await fetch('https://api.apikodu.com/api/v1/agriculture/harvestwindow', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
name: 'example',
value: 123
})
});
const data = await response.json();
console.log(data);
import requests
headers = {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
}
payload = {
'name': 'example',
'value': 123
}
response = requests.post('https://api.apikodu.com/api/v1/agriculture/harvestwindow', headers=headers, json=payload)
data = response.json()
print(data)
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "YOUR_API_KEY");
var payload = new { name = "example", value = 123 };
var json = JsonSerializer.Serialize(payload);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.apikodu.com/api/v1/agriculture/harvestwindow", content);
response.EnsureSuccessStatusCode();
var data = await response.Content.ReadAsStringAsync();
Console.WriteLine(data);
$data = [
'name' => 'example',
'value' => 123
];
$response = file_get_contents('https://api.apikodu.com/api/v1/agriculture/harvestwindow', false, stream_context_create([
'http' => [
'header' => "x-api-key: YOUR_API_KEY"
],
'method' => 'POST',"
'content' => json_encode($data)
]));
print_r(json_decode($response, true));
curl -X POST 'https://api.apikodu.com/api/v1/agriculture/harvestwindow' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY' \
-d '{
"name": "example",
"value": 123
}'
Hemen denemeye başlayın
Ücretsiz hesap açın, API anahtarınızı alın ve ilk isteğinizi dakikalar içinde gönderin.