Leaf’s API outputs GeoJSON, GeoTIFF, and PNG data that maps directly into ArcGIS workflows. This tutorial covers two integration patterns: consuming data in ArcGIS Pro with Python toolboxes, and automating data ingest in ArcGIS Enterprise with geoprocessing services.Documentation Index
Fetch the complete documentation index at: https://docs.withleaf.io/llms.txt
Use this file to discover all available pages before exploring further.
Before you start
- A Leaf account with API credentials and at least one connected provider or sample data.
- ArcGIS Pro 3.x or ArcGIS Enterprise 11.x (or later).
- Python 3.9+ with
requestsandarcpyavailable (bundled with ArcGIS Pro). - The sample toolboxes from Leaf’s ArcGIS GitHub repo.
ArcGIS Pro
Step 1: Set up authentication
Communication with the Leaf API requires a bearer token. The sample toolbox includes an authentication tool that stores the token in a temporary table for use by other tools.Step 2: Fetch field boundaries
The Get Field Boundaries tool combines data from multiple Leaf endpoints (growers, farms, fields, and boundaries) and converts them into a feature layer in your ArcGIS Pro map. The Leaf API returns boundaries as GeoJSON. The toolbox converts them to features usingarcpy.JSONToFeatures_conversion. Fields from different providers appear in a single layer with attributes like provider, farm name, and field name.
Step 3: Display satellite imagery
Leaf’s crop monitoring endpoints return GeoTIFF and PNG images for NDVI, NDRE, and RGB. You can download these and add them as raster layers.Step 4: Load field operations
Field operations expose a standard GeoJSON download URL. Fetch the download URL first, then download the actual GeoJSON and convert it to a feature layer:yieldVolume, seedRate, and appliedRate that you can use for symbology and analysis.
ArcGIS Enterprise
For automated workflows, publish a geoprocessing service that acts as a webhook for Leaf alerts. When new data arrives, Leaf sends an alert to your geoprocessing service, which downloads and processes the data automatically.Step 5: Create a geoprocessing webhook
Write a Python toolbox that accepts the parameters for the specific Leaf event you subscribe to. FornewSatelliteImage, the payload includes:
| Parameter | Type | Description |
|---|---|---|
externalId | String | Your satellite field external ID |
processId | String | The satellite process ID |
type | String | Alert type, for example newSatelliteImage |
timestamp | String | When the alert fired |
X-Leaf-Signature | String | HMAC signature for validation |
Step 6: Validate the signature
Every alert from Leaf includes anX-Leaf-Signature header. Validate it against your secret to confirm the request came from Leaf:
Step 7: Publish and register
- Publish the geoprocessing service following ArcGIS Pro’s publishing guide.
- The service must be publicly accessible (Leaf needs to reach it).
- Register the service URL as a Leaf alert endpoint:
/submitJob?f=json for asynchronous geoprocessing or /execute?f=json for synchronous.

