Skip to content

Index statistics

GET /v1/fields/{id}/statistics returns one row of statistics per imagery date: how a vegetation index was distributed over the field’s pixels on that day. It is the call to use for crop development charts, anomaly alerts and season comparisons.

Python and JavaScript examples reuse API, session, headers and the field id from the Quickstart.

Parameter Required Notes
index yes One of the indices below.
from yes First day, YYYY-MM-DD.
to yes Last day, YYYY-MM-DD, on or after from and at most 366 days later.
source no sentinel-2 (default) or planet.
curl "https://api.agrosat.uz/v1/fields/cmgz7k2qv0004l8p3a9d1x6rt/statistics?index=ndvi&from=2026-04-01&to=2026-09-30" \
-H "X-API-Key: $AGROSAT_API_KEY"

If the field or the window is not prepared yet, the answer is 202 data_pending with Retry-After. Wait and repeat; see Field readiness.

{
"success": true,
"data": {
"field_id": "cmgz7k2qv0004l8p3a9d1x6rt",
"index": "ndvi",
"data": [
{
"date": "2026-05-04",
"mean": 0.5871, "median": 0.6012, "min": 0.1544, "max": 0.7785,
"std": 0.0962, "p10": 0.4518, "p90": 0.6973,
"valid_fraction": 0.9934, "cloud_fraction": 0.0066, "cloud_mask": "scl_cld"
},
{
"date": "2026-05-09",
"mean": null, "median": null, "min": null, "max": null,
"std": null, "p10": null, "p90": null,
"valid_fraction": 0, "cloud_fraction": 1, "cloud_mask": "scl_cld"
}
],
"unavailable_dates": []
}
}

Rows are ordered by date, oldest first. Each row has:

Member Meaning
date Imagery date, YYYY-MM-DD.
mean, median Mean and median index value over the valid pixels of the field.
min, max Lowest and highest valid pixel value.
std Standard deviation: how uneven the field is.
p10, p90 10th and 90th percentiles. Less sensitive to stray pixels at the field edge than min and max.
valid_fraction Share of the field’s pixels that were usable, from 0 to 1.
cloud_fraction Share of the field’s pixels masked as cloud, from 0 to 1, or null if not known.
cloud_mask sentinel-2 only: the cloud mask used, scl_cld or scl. See Cloud masks.

When no pixel of the field was usable on a date, the row is still there, with every value null and valid_fraction 0. That tells you the satellite passed but saw nothing, which is different from no pass at all.

unavailable_dates lists dates that have imagery but whose statistics could not be computed in the last 24 hours. Usually it is empty; see Field readiness.

index Name Formula Typical range Planet
ndvi Normalized Difference Vegetation Index (NIR − Red) / (NIR + Red) −1 to 1 yes
ndre Normalized Difference Red Edge (NIR − RedEdge) / (NIR + RedEdge) −1 to 1 yes
ndmi Normalized Difference Moisture Index (NIR − SWIR1) / (NIR + SWIR1) −1 to 1 —
msavi Modified Soil-Adjusted Vegetation Index (2·NIR + 1 − √((2·NIR + 1)² − 8·(NIR − Red))) / 2 −1 to 1 yes
evi Enhanced Vegetation Index 2.5·(NIR − Red) / (NIR + 6·Red − 7.5·Blue + 1) −1 to 1 yes
gndvi Green NDVI (NIR − Green) / (NIR + Green) −1 to 1 yes
rci Red-edge Chlorophyll Index NIR / RedEdge − 1 0 to 10 yes
rendvi Red-edge NDVI (RedEdge2 − RedEdge1) / (RedEdge2 + RedEdge1) −1 to 1 —
sipi Structure Insensitive Pigment Index (NIR − Blue) / (NIR − Red) 0 to 2 yes
gci Green Chlorophyll Index NIR / Green − 1 0 to 10 yes
ndpi Normalized Difference Pond Index (SWIR1 − Green) / (SWIR1 + Green) −1 to 1 —

Any other value is refused with 400 invalid_index.

  • sentinel-2 is the default and available to every organization.
  • planet serves PlanetScope data and is available only to organizations with a separate Planet agreement. Without one the request fails with 403 source_not_enabled. Planet supports the indices marked in the table above; others fail with 400 invalid_index. Planet rows have no cloud_mask.

A successful response costs ceil(area_ha × dates returned / 10) units, at least 1. Every row in data counts as a returned date, including fully clouded ones. For the 41.53 ha example field, 6 dates cost ceil(41.53 × 6 / 10) = 25 units.

A response with no rows costs 0. So does every 202. The units used are in the X-AgroSat-Units response header. See Units and hectares.