Leaf-N-alysis · URL Sharing API

Share a diagnosed sample as a link using crop, region & stage codes
← Back to app

Overview

Any sample can be opened directly from a URL. The app reads the crop from the path and the sample from the query string, then fills the Single-sample form and runs the diagnosis automatically.

https://<host>/<crop>?region=<code>&stage=<code>&<nutrient>=<value>  &id=<label>

Parameters

LocationParameterMeaning
path<crop> requiredCrop slug, e.g. corn. Defaults to corn if the path is empty.
queryregion requiredAny one of: the region number code (e.g. 2), a US state abbreviation (e.g. TX → its DRIS region), or the full region name.
querystage requiredGrowth-stage letter code (e.g. B).
querynutrient symbolsOne per tissue value, e.g. N=3.89, P=0.21. Macros in %, micros in ppm. Include only the ones you have.
queryid optionalFree-text customer / field label shown on the report & PDF.

Backward compatible: older #load={json} links still open correctly.

Live builder

Reference codes

Pulled live from this server, so they always match the current data.

Fetch codes programmatically

Two read-only JSON endpoints expose everything the builder uses:

List crops

GET /api/crops
 [ { "slug": "corn", "name": "Corn" }, … ]

Crop bundle (codes live under meta)

GET /api/crops/corn
 { "meta": {
    "labels":      ["N","P","K", …],        // nutrient symbols
    "regionCodes": { "South/Delta": "2", … }, // name → region code
    "stages":      ["A","B","C", …],        // stage codes
    "stageDesc":   { "B": "V5–V8", … },       // stage code → label
    "units":       { "N": "%", "Zn": "ppm", … }
  }, … }