{"openapi": "3.1.0", "info": {"title": "cropauth: DE + FR plant protection product authorisations", "version": "1.1.0", "description": "Read-only JSON API over two public registers: the German BVL PSM-API (Pflanzenschutzmittel-Zulassungen) and the French Anses E-Phy catalogue (data.gouv.fr). Both are snapshotted daily. Every change at row level between snapshots is kept as a dated change feed.\n\nEvery record carries its source URL, the source's Stand (release date) and the attribution line its licence requires:\n- BVL PSM-API Nutzungsbedingungen v1.0 §3\n- Licence Ouverte 2.0 / «Données E-Phy - Anses»\n\nNot legal advice / keine Rechtsberatung / ceci n'est pas un conseil juridique. Unofficial copy of public register data; always check the official register and the product label before use.\n\nIndependent publisher. Not affiliated with BVL, Anses, data.gouv.fr or any manufacturer.", "license": {"name": "Data: Licence Ouverte 2.0 (FR, Anses E-Phy); BVL PSM-API Nutzungsbedingungen v1.0 (DE)"}}, "servers": [{"url": "/"}], "paths": {"/v1/search": {"get": {"summary": "Search products (incl. second trade names and FR parallel-trade permits), active substances or crops by name", "operationId": "search", "parameters": [{"name": "q", "in": "query", "required": true, "schema": {"type": "string", "minLength": 2}, "description": "Name, or part of it. Case and accents are ignored. For products every query word must start a word of the name. For substances and crops a substring is enough. A 7-digit FR AMM number or a DE Kennnummer (e.g. 024337-00) is also accepted."}, {"name": "type", "in": "query", "schema": {"type": "string", "enum": ["product", "substance", "crop"], "default": "product"}}, {"name": "country", "in": "query", "schema": {"type": "string", "enum": ["de", "fr"]}, "description": "Omit to search both."}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 100, "default": 25}}], "responses": {"200": {"description": "Matches", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/SearchResult"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "429": {"$ref": "#/components/responses/RateLimited"}, "503": {"description": "Daily request budget of this free service used up; Retry-After gives the seconds until 00:00 UTC.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/products/{country}/{id}": {"get": {"summary": "One product. FR includes all uses (current and withdrawn) with end_of_sale / end_of_use grace dates, conditions of use, hazard classes and parallel-trade permits. DE includes Anwendungen with crops (decoded EPPO/BVL codes), target organisms (uses[].targets), pre-harvest intervals per crop (uses[].pre_harvest_intervals: days or a decoded note), authorisation end dates, active substance contents, distributors (company name and country), German parallel-import permits (parallel_imports, list valid|expired), and the Aufbrauchfrist of expired products.", "operationId": "getProduct", "parameters": [{"name": "country", "in": "path", "required": true, "schema": {"type": "string", "enum": ["de", "fr"]}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "FR: numéro AMM or PCP permit number. DE: Kennnummer (e.g. 024337-00)."}], "responses": {"200": {"description": "Product document", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Doc"}}}}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}, "503": {"description": "Daily request budget of this free service used up; Retry-After gives the seconds until 00:00 UTC.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/substances/{country}/{id}": {"get": {"summary": "One active substance and the products containing it", "operationId": "getSubstance", "parameters": [{"name": "country", "in": "path", "required": true, "schema": {"type": "string", "enum": ["de", "fr"]}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "FR: substance name as in E-Phy (e.g. Glyphosate). DE: BVL Wirkstoffnummer (e.g. 0237). Use /v1/search?type=substance."}], "responses": {"200": {"description": "Substance document", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Doc"}}}}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}, "503": {"description": "Daily request budget of this free service used up; Retry-After gives the seconds until 00:00 UTC.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/crops/{country}/{id}": {"get": {"summary": "Products usable on one crop: FR uses that are authorised or within their end_of_use grace period; DE authorised Anwendungen per crop code", "operationId": "getCrop", "parameters": [{"name": "country", "in": "path", "required": true, "schema": {"type": "string", "enum": ["de", "fr"]}}, {"name": "id", "in": "path", "required": true, "schema": {"type": "string"}, "description": "FR: crop label from the E-Phy usage identifier (e.g. Blé, Vigne). DE: BVL/EPPO crop code (e.g. TRZAW). Use /v1/search?type=crop."}], "responses": {"200": {"description": "Crop document", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Doc"}}}}, "404": {"$ref": "#/components/responses/NotFound"}, "429": {"$ref": "#/components/responses/RateLimited"}, "503": {"description": "Daily request budget of this free service used up; Retry-After gives the seconds until 00:00 UTC.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/changes": {"get": {"summary": "Change feed: every row added, removed or changed between consecutive source snapshots, oldest first", "operationId": "listChanges", "parameters": [{"name": "country", "in": "query", "schema": {"type": "string", "enum": ["de", "fr"]}}, {"name": "product", "in": "query", "schema": {"type": "string"}, "description": "FR AMM / DE Kennnummer. For FR parallel-trade rows this is the French reference product; filter the permit itself with entity=."}, {"name": "entity", "in": "query", "schema": {"type": "string"}, "description": "Row key within the source table, e.g. a PCP permit number or '2080098|Résistances'"}, {"name": "table", "in": "query", "schema": {"type": "string"}, "description": "Source table: E-Phy CSV file name (e.g. produits_usages_utf8.csv) or BVL table (e.g. awg_zulassung)"}, {"name": "op", "in": "query", "schema": {"type": "string", "enum": ["added", "removed", "changed", "schema"]}}, {"name": "since", "in": "query", "schema": {"type": "string"}, "description": "ISO date/time; returns changes first seen at or after it"}, {"name": "after_id", "in": "query", "schema": {"type": "integer"}, "description": "Cursor: returns changes with id greater than this (use `next`)"}, {"name": "limit", "in": "query", "schema": {"type": "integer", "minimum": 1, "maximum": 500, "default": 100}}], "responses": {"200": {"description": "Changes", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ChangeFeed"}}}}, "400": {"$ref": "#/components/responses/BadRequest"}, "429": {"$ref": "#/components/responses/RateLimited"}, "503": {"description": "Daily request budget of this free service used up; Retry-After gives the seconds until 00:00 UTC.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/snapshots": {"get": {"summary": "Every stored source snapshot: source, Stand, when first seen, number of row changes", "operationId": "listSnapshots", "responses": {"200": {"description": "Snapshots", "content": {"application/json": {"schema": {"type": "object"}}}}, "503": {"description": "Daily request budget of this free service used up; Retry-After gives the seconds until 00:00 UTC.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}, "/v1/status": {"get": {"summary": "Freshness: latest snapshot per source, last successful daily fetch, last document build", "operationId": "status", "responses": {"200": {"description": "Status", "content": {"application/json": {"schema": {"type": "object"}}}}, "503": {"description": "Daily request budget of this free service used up; Retry-After gives the seconds until 00:00 UTC.", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}}, "components": {"schemas": {"Source": {"type": "object", "properties": {"name": {"type": "string"}, "url": {"type": "string"}, "file": {"type": "string"}, "stand": {"type": "string", "description": "Release date of the source data"}, "line": {"type": "string", "description": "Attribution line required by the source licence; reproduce it when you republish"}, "first_seen_by_us": {"type": "string"}}}, "Doc": {"type": "object", "description": "Product, substance or crop document. Fields depend on country and kind; empty fields are omitted.", "properties": {"country": {"type": "string"}, "id": {"type": "string"}, "kind": {"type": "string", "enum": ["product", "parallel_trade_permit", "substance", "crop"]}, "name": {"type": "string"}, "status": {"type": "string", "description": "As published: FR AUTORISE/RETIRE; DE authorised/expired"}, "source": {"$ref": "#/components/schemas/Source"}, "history": {"type": "object"}, "disclaimer": {"type": "string"}}, "additionalProperties": true}, "SearchResult": {"type": "object", "properties": {"query": {"type": "string"}, "type": {"type": "string"}, "count": {"type": "integer"}, "total_matches": {"type": "integer"}, "results": {"type": "array", "items": {"type": "object", "properties": {"country": {"type": "string"}, "id": {"type": "string"}, "name": {"type": "string"}, "status": {"type": "string"}, "kind": {"type": "string"}, "match": {"type": "string"}, "url": {"type": "string"}}}}, "disclaimer": {"type": "string"}}}, "Change": {"type": "object", "properties": {"id": {"type": "integer"}, "first_seen": {"type": "string", "description": "When our daily fetch first saw the snapshot containing this change"}, "country": {"type": "string"}, "table": {"type": "string"}, "op": {"type": "string"}, "entity": {"type": "string"}, "product": {"type": ["string", "null"]}, "changed_columns": {"type": ["array", "null"], "items": {"type": "string"}}, "old": {"type": ["object", "null"], "description": "Full source row before (verbatim)"}, "new": {"type": ["object", "null"], "description": "Full source row after (verbatim)"}, "source": {"$ref": "#/components/schemas/Source"}}}, "ChangeFeed": {"type": "object", "properties": {"count": {"type": "integer"}, "next": {"type": ["string", "null"]}, "note": {"type": "string"}, "disclaimer": {"type": "string"}, "items": {"type": "array", "items": {"$ref": "#/components/schemas/Change"}}}}, "Error": {"type": "object", "properties": {"error": {"type": "object", "properties": {"status": {"type": "integer"}, "message": {"type": "string"}}}}}}, "responses": {"NotFound": {"description": "Not found", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "BadRequest": {"description": "Invalid parameter", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}, "RateLimited": {"description": "More than 60 requests per minute from one IP", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}}}}}