Getting Started

Retrieve an Analysis

Once a request reaches the "Success" status, you can retrieve the results in multiple formats: color legends, PNG images, GeoTIFF files, and JSON statistics.

Retrieval Queries

Each analysis type has a corresponding retrieval query. For example:

  • retrievePlantHealth() — for plant health (NDVI) results
  • retrieveWaterStress() — for water stress (NDWI) results
  • retrieveVegetationIndices() — for general vegetation index results
  • retrieveCrudeProtein() — for crude protein results

All retrieval queries share the same three parameters: polygonId, startDate, and endDate.

Example Request

GraphQL Query
query { retrievePlantHealth( polygonId: "abc123-def456-ghi789" startDate: "2025-06-01" endDate: "2025-08-31" ) { colorlegend png tif json } }

Response Formats

Each retrieval query can return up to four types of data:

Field Type Description
colorlegend String (URL) A static reference image showing the color scale used in the analysis. This is the same for all results of a given analysis type.
png Array of URLs PNG images of the analysis results, one per available satellite date. Suitable for display in a UI.
tif Array of URLs GeoTIFF files with georeferenced raster data. Suitable for GIS software and programmatic processing.
json Array of Objects Statistical summaries for each date, including min, max, mean, and standard deviation values.

Example Response

JSON Response
{ "data": { "retrievePlantHealth": { "colorlegend": "https://api.agdir.no/legends/ndvi.png", "png": [ "https://api.agdir.no/results/abc123/2025-06-15.png", "https://api.agdir.no/results/abc123/2025-07-02.png" ], "tif": [ "https://api.agdir.no/results/abc123/2025-06-15.tif", "https://api.agdir.no/results/abc123/2025-07-02.tif" ], "json": [ { "date": "2025-06-15", "min": 0.12, "max": 0.87, "mean": 0.64, "std": 0.15 } ] } } }

Note: The number of results depends on how many cloud-free satellite passes occurred during your date range. A 3-month range typically returns 10–20 images.

Next Steps

You now know the full workflow: register, generate, monitor, and retrieve. Explore the Usage section for detailed documentation on each analysis type, including vegetation indices, crude protein, soil moisture, and more.