canonical: https://jentic.com/apis/api-test.agrimetrics.co.uk/agrimetrics

# Api Test Agrimetrics Agrimetrics Catalog API

Agrimetrics Catalog API exposes the agri-environmental data catalogue published by Agrimetrics, covering datasets, layers, query execution, and shapefile uploads for spatial analysis. The 93 endpoints include dataset discovery, layer metadata, SPARQL-style query execution, and authenticated download of layer files. The base host is api-test.agrimetrics.co.uk for the test environment, with multiple authentication schemes supported: an Azure APIM subscription key (ocp-apim-subscription-key), a JWT bearer token, header- or query-style API keys, and an x-user header.

## For AI agents

Discover Agrimetrics agri-environmental datasets, query their layers, run spatial queries with shapefiles, and download layer files via 93 catalogue endpoints.

## Scope

Does not handle farm-management workflows, livestock records, or non-spatial agri analytics - use for Agrimetrics catalogue discovery, layer access, and shapefile-scoped queries only.

## Capabilities

- Authenticate against the Agrimetrics catalogue using either an APIM subscription key, a JWT, or one of the API-key schemes
- Discover datasets and their associated layers via /datasets/{datasetId} and /datasets/{datasetId}/layers
- Execute structured queries against the catalogue via /query for cross-dataset analysis
- Upload a shapefile via /shapefile to scope subsequent queries to a custom area of interest
- Download layer file contents via /layers/{layerId}/files for downstream processing

## Use cases

### Discover Datasets for an Agri Workflow

Walk the Agrimetrics catalogue programmatically to surface the datasets and layers that match an agri-environmental workflow, such as crop yield modelling or soil-type analysis. Calling /datasets/{datasetId} and /datasets/{datasetId}/layers gives the structural metadata needed to stitch together a downstream geospatial pipeline. The catalogue covers UK agri data published by Agrimetrics.

Example prompt: Call /datasets/{datasetId} for a candidate dataset, then /datasets/{datasetId}/layers to enumerate the layers and pick the ones that match the workflow

### Spatial Query With a Custom Boundary

Upload a shapefile defining a farm boundary or a study region via /shapefile, then run /query against the Agrimetrics catalogue to retrieve only the layer values that fall within the boundary. This is the core pattern for scoped agri-environmental analysis: retrieve only the relevant pixels for a specific geographic area rather than downloading whole national layers.

Example prompt: POST a farm boundary shapefile to /shapefile, capture the returned id, and call /query with that boundary id and a chosen layer id

### Layer File Download Pipeline

Pull layer file contents via /layers/{layerId}/files into a downstream raster or vector pipeline. The endpoint returns the underlying file references for a chosen layer, which a processing job can then download and feed into GIS tooling. This is useful when the workflow needs the raw layer data rather than catalogue metadata.

Example prompt: Call /layers/{layerId}/files for a chosen layer id, capture the file references, and queue them for download into the GIS pipeline

### Agent Integration via Jentic

An AI agent built on Jentic can search for the Agrimetrics catalogue operations by intent and execute them without holding the APIM subscription key in agent context. Jentic's your Jentic One instance holds the credential and returns scoped access at call time, which matters when an agri-tech workflow combines Agrimetrics with multiple other geospatial providers.

Example prompt: Use Jentic search for 'list agrimetrics datasets', load the dataset endpoint, execute it, and pass the chosen dataset id into a follow-up layers call

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /authenticate | Authenticate against the catalogue |
| GET | /status | Catalogue status check |
| POST | /query | Run a structured catalogue query |
| GET | /datasets/{datasetId} | Read a dataset by id |
| GET | /datasets/{datasetId}/layers | List the layers belonging to a dataset |
| POST | /shapefile | Upload a shapefile to scope subsequent queries |
| GET | /layers/{layerId} | Read layer metadata by id |
| GET | /layers/{layerId}/files | Get the file references for a layer |

## Key resources

- **Authentication** — Multiple auth options: APIM subscription key, JWT, header- or query-style API keys, and x-user header
- **Datasets** — Discover datasets and their associated layers via /datasets/{datasetId} and /datasets/{datasetId}/layers
- **Layers** — Read layer metadata and download files via /layers/{layerId} and /layers/{layerId}/files
- **Query** — Run structured catalogue queries via /query
- **Shapefile** — Upload a shapefile to scope subsequent queries via /shapefile
- **Status** — Catalogue status check via /status

## Why Jentic

- **Setup:** Wiring the Agrimetrics Catalog API by hand means choosing between its API key and bearer auth, calling the authenticate route, and mapping the dataset, layer, and shapefile routes across 93 endpoints yourself. Through Jentic you install once, import Agrimetrics from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Agrimetrics puts the dataset and layer id in the URL path (/datasets/{datasetId}/layers, /layers/{layerId}/files), so a rule can pin your agent to one dataset or layer: it can read that layer's files and nothing else. You choose the operations it may call, so a shapefile query is only included if you add it.
- **Credential handling:** Your Agrimetrics credential, whether an APIM subscription key, JWT, or API key, is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list Agrimetrics datasets' or 'run a shapefile spatial query', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **NASA Open APIs** — Open NASA earth and space data including imagery and asteroids feeds
- **OpenCage Geocoding** — Forward and reverse geocoding to resolve addresses around an Agrimetrics boundary
- **Geocodio** — Bulk address geocoder for joining tabular records to coordinates

## FAQ

### What authentication does the Agrimetrics Catalog API use?

Multiple schemes are supported: an Azure APIM subscription key in ocp-apim-subscription-key, a JWT bearer token, an apiKeyHeader or apiKeyQuery API key, and an x-user header. Use whichever matches your Agrimetrics account setup. Through Jentic the credential is held in the vault and only a scoped token is granted to the agent at call time.

### Can I run spatial queries scoped to a custom boundary?

Yes. POST a shapefile to /shapefile to register a boundary, then call /query referencing that boundary id and the chosen layer id. The catalogue returns only the layer values that fall within the supplied geometry.

### What are the rate limits for the Agrimetrics Catalog API?

The OpenAPI spec does not declare explicit rate limits. Treat the API as standard HTTPS and respect any 429 responses; check your Agrimetrics account dashboard for the contractual ceiling for your subscription tier.

### How do I list available datasets through Jentic?

Install the Jentic SDK with pip install jentic, search for 'list agrimetrics datasets', load the dataset operation, and execute it. Run it through Jentic One, the self-hosted execution layer to get a Jentic agent key.

### Is api-test.agrimetrics.co.uk the production host?

No. api-test.agrimetrics.co.uk is the test host published in this spec. For production traffic you may need to repoint to the live Agrimetrics host once your Agrimetrics representative provides credentials, while keeping the same endpoint shapes.

### Can I download the underlying layer files?

Yes. GET /layers/{layerId}/files returns the file references for a chosen layer, which a downstream pipeline can then fetch into GIS tooling. Pair with /datasets/{datasetId}/layers to discover which layer ids belong to a dataset.

### Can I limit what my agent is allowed to do with the Agrimetrics Catalog API?

Yes. Because you run Jentic One yourself, your own rules decide which of the 93 Agrimetrics operations and which credential the agent may use. Since the dataset and layer ids sit in the URL path, such as /datasets/{datasetId}/layers and /layers/{layerId}/files, you can pin the agent to a single dataset or layer so it reads only that layer's files and nothing else. You also choose whether operations like the /shapefile upload and /query calls are exposed at all, so a spatial query is available only if you add it.
