{
  "openapi": "3.0.1",
  "info": {
    "title": "EU Agricultural Commodity Prices | Dairy, Cereal, Beef, Sugar",
    "description": "Get official EU dairy, cereal, beef and sugar market prices from the European Commission's Agri-food Data Portal, normalized into one schema. Optional NL agri-input prices via CBS.",
    "version": "0.1",
    "x-build-id": "GM3SqsHCEdaqWzOEL"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/codeclouds~agrigrondstofprijzen-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-codeclouds-agrigrondstofprijzen-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/codeclouds~agrigrondstofprijzen-monitor/runs": {
      "post": {
        "operationId": "runs-sync-codeclouds-agrigrondstofprijzen-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/codeclouds~agrigrondstofprijzen-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-codeclouds-agrigrondstofprijzen-monitor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Which EU Agri-food Data Portal categories to fetch.",
            "items": {
              "type": "string",
              "enum": [
                "dairy",
                "cereal",
                "beef",
                "sugar"
              ]
            },
            "default": [
              "dairy",
              "cereal",
              "beef",
              "sugar"
            ]
          },
          "memberStates": {
            "title": "Member States",
            "type": "array",
            "description": "ISO country codes to filter dairy/cereal/beef by, e.g. [\"NL\", \"BE\", \"DE\"]. Leave empty for all available member states. Has no effect on sugar (EU-wide/regional data only, no per-country breakdown in this API).",
            "default": [
              "NL"
            ],
            "items": {
              "type": "string"
            }
          },
          "yearFrom": {
            "title": "Year From",
            "type": "integer",
            "description": "Earliest year to fetch, e.g. 2024. Leave empty to only fetch the current year."
          },
          "yearTo": {
            "title": "Year To",
            "type": "integer",
            "description": "Latest year to fetch, e.g. 2026. Leave empty to only fetch the current year."
          },
          "includeCbs": {
            "title": "Include CBS Landbouwprijzen (NL input prices)",
            "type": "boolean",
            "description": "Also fetch Dutch agricultural input prices (fertilizer, fuel, electricity) from CBS StatLine table 86337NED. Adds items with source \"cbs\".",
            "default": false
          },
          "maxResults": {
            "title": "Max Results",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of price records to return in total across all categories/sources (1-5000).",
            "default": 500
          },
          "productFilter": {
            "title": "Product Filter",
            "type": "string",
            "description": "Only return records whose 'product' field contains this text (case-insensitive), e.g. \"butter\" to get only butter prices from the dairy category. Leave empty for no filter."
          },
          "berekenTrends": {
            "title": "Calculate period-over-period trends",
            "type": "boolean",
            "description": "Adds a period-over-period percentage change field, calculated purely from the already-fetched period range (no extra data source). Only charged (trend-record) when a previous period's value was actually found within the fetched range.",
            "default": false
          },
          "alertOpDrempel": {
            "title": "Alert on significant price change since previous run",
            "type": "boolean",
            "description": "Compares each product's price with the previous run (via the actor's key-value store) and charges the extra price-alert event when the absolute percentage change reaches the threshold.",
            "default": false
          },
          "alertDrempelPercentage": {
            "title": "Price alert threshold (%)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum absolute percentage change vs. the previous run to count as a price-alert. Only relevant when 'Alert on significant price change' is enabled.",
            "default": 5
          },
          "berekenMargeIndicator": {
            "title": "Build farm-margin indicator",
            "type": "boolean",
            "description": "Adds a margin-record with the ratio of average EU dairy price to CBS fertilizer price, when both dairy and CBS input data are available in this run. New charged event 'margin-record' ($0.006), only when both source prices are actually available.",
            "default": false
          },
          "trackAlertStreak": {
            "title": "Track alert streaks (momentum)",
            "type": "boolean",
            "description": "With 'Alert on significant price change' enabled: signals when a group has crossed the threshold in the same direction for multiple consecutive runs (a sustained trend, not a one-off spike). New charged event 'alert-streak-signaal' ($0.01), only when a streak of 2 or more is actually detected.",
            "default": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}