{"openapi":"3.1.0","info":{"title":"Tilth Fertiliser Price API","description":"Independent UK Fertiliser Price Index & Exchange","contact":{"name":"Mario Altimari","email":"altimario@gmail.com"},"license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"version":"1.0.0"},"servers":[{"url":"https://www.tilth.uk","description":"Tilth public API"}],"paths":{"/api/v1/public/fertiliser/dataset":{"get":{"tags":["Public Fertiliser Data"],"summary":"GET /api/v1/public/fertiliser/dataset: self-describing estimate history for\none product, wrapped in the CC BY 4.0 dataset envelope for AI agents.\nAppend `?format=csv` for a spreadsheet download of the same points.","description":"`data` is newest-first and capped at the hub's LIMIT (400 points).","operationId":"public_fertiliser_dataset","parameters":[{"name":"product","in":"query","description":"Fertiliser product code (AN_UK, UREA_GRANULAR, DAP, MOP, AN_IMPORT, UAN, TSP, POLYSULPHATE, NITRATE_SULPHUR)","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Optional: 'csv' for a spreadsheet download of the estimate points","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"CC BY 4.0 dataset envelope (JSON), or a CSV download when format=csv. The envelope carries provider, licence, schema_version, unit, product, and `data` (newest-first estimate history, capped at 400 points). Compare `as_of` (data date), not `generated_at` (may be edge-cached up to 5 minutes)."},"400":{"description":"Unknown/missing product code; the message enumerates the valid set"},"502":{"description":"Intelligence hub error"}}}},"/api/v1/public/fertiliser/latest":{"get":{"tags":["Public Fertiliser Data"],"summary":"GET /api/v1/public/fertiliser/latest: current estimate per product (all 9),\nor one when `product` is given, in the CC BY 4.0 envelope. The \"one number\"\nendpoint for agents. Points carry the track record (`within_gbp_t`,\n`hit_rate_n_of_10`) already public via the bare `/fertiliser` feed.","operationId":"public_fertiliser_latest","parameters":[{"name":"product","in":"query","description":"Optional fertiliser product code to narrow to one product","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"CC BY 4.0 dataset envelope. Without `product`, `data` is the current point per product (each carrying its own `product` code) and the top-level `product` block is omitted. With `product`, narrows to that one. An empty `data` with a null `as_of` means the estimate is not yet computed, not that the price is zero."},"400":{"description":"Unknown product code; the message enumerates the valid set"},"502":{"description":"Intelligence hub error"}}}},"/api/v1/public/fertiliser/official-index-comparison":{"get":{"tags":["Public Fertiliser Data"],"summary":"GET /api/v1/public/fertiliser/official-index-comparison: rebased overlay of\nthe daily forecast against the official DEFRA agricultural price index for\none nutrient family. A pass-through proxy to the hub, unlike `/dataset` and\n`/latest`: the hub already returns the exact JSON shape this endpoint\npublishes (`eligible`, `overlay_points`, `n_months`, `official_lag_days`),\nso there is no envelope to build on this side, just forward and relay.","operationId":"public_fertiliser_official_index","parameters":[{"name":"product","in":"query","description":"Fertiliser product code (AN_UK, UREA_GRANULAR, DAP, MOP, AN_IMPORT, UAN, TSP, POLYSULPHATE, NITRATE_SULPHUR)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Rebased overlay of the daily forecast vs the official DEFRA index for the requested product: eligible (false when the product has no DEFRA-mapped nutrient series, or the two series aren't structurally distinct, or the forecast isn't yet in modelled stage), overlay_points (month, forecast_rebased, official_rebased, official_carried_forward), n_months, official_lag_days. Consistency and lead time only, not an accuracy claim."},"502":{"description":"Intelligence hub error"},"503":{"description":"Intelligence hub not configured"}}}},"/api/v1/public/fertiliser/openapi.json":{"get":{"tags":["Public Fertiliser Data"],"summary":"GET /api/v1/public/fertiliser/openapi.json: the public fertiliser API\ncontract only (never the full authenticated surface). Served unconditionally\nso agents can ingest it; sits inside the robots Allow prefix and the wildcard\nCORS scope.","operationId":"public_fertiliser_openapi","responses":{"200":{"description":"OpenAPI JSON contract for the public fertiliser API surface"}}}}},"components":{},"externalDocs":{"url":"https://www.tilth.uk/data","description":"Tilth open data documentation"}}