Getting Started

Getting Started with the Agdir Satellite API

Learn how to authenticate, register field boundaries, generate satellite analyses, and retrieve results through the Agdir GraphQL API.

Overview

The Agdir Satellite API gives you programmatic access to a wide range of satellite-based crop analytics. From vegetation indices and plant health to soil moisture and crude protein, the API delivers results as images, GeoTIFFs, and structured JSON data.

All interactions happen through a single GraphQL endpoint:

Endpoint
https://satellite.agdir.farm/graphql

Authentication

The API uses token-based authentication. Include your bearer token in the Authorization header of every request.

HTTP Header
Authorization: Bearer YOUR_API_TOKEN

Need a token? API tokens are provided by the Agdir team. Contact support@agdir.no to request access.

API Playground

Agdir provides an interactive API playground where you can explore the schema, test queries, and view responses in real time. This is the fastest way to familiarize yourself with the available mutations and queries before writing integration code.

Core Workflow

Working with the Agdir Satellite API follows a consistent four-step pattern:

  1. Register a Polygon — Define the geographic boundary of your field using GeoJSON coordinates.
  2. Generate an Analysis — Request a specific analysis (plant health, water stress, etc.) for your polygon over a date range.
  3. Monitor the Request — Track the progress of your request through the processing pipeline.
  4. Retrieve the Results — Download the finished analysis as images, GeoTIFFs, or JSON statistics.

GraphQL Basics

If you are new to GraphQL, here is a quick primer. GraphQL uses two types of operations:

  • Mutations — Used to create or trigger actions (e.g., registering a polygon, starting an analysis).
  • Queries — Used to read data (e.g., retrieving analysis results, checking request status).

Every request is a POST to the GraphQL endpoint with a JSON body containing your query (or mutation) and optional variables.

Example cURL request
curl -X POST https://satellite.agdir.farm/graphql \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -d '{"query": "{ retrievePolygons(benefactor: \"my-org\") { polygonId label } }"}'

Next Steps

Start by registering your first polygon, then work through the guides in order. Each page includes complete GraphQL examples you can copy and adapt.