# EU Agricultural Commodity Prices | Dairy, Cereal, Beef, Sugar (`codeclouds/agrigrondstofprijzen-monitor`) Actor

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.

- **URL**: https://apify.com/codeclouds/agrigrondstofprijzen-monitor.md
- **Developed by:** [Dennis](https://apify.com/codeclouds) (community)
- **Categories:** Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $4.00 / 1,000 price-records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## EU Agricultural Commodity Prices — Dairy, Cereal, Beef, Sugar

Get official EU dairy, cereal, beef and sugar market prices straight from the European Commission's
Agri-food Data Portal, normalized into a single, consistent JSON schema. Optional add-on: Dutch
agricultural input prices (fertilizer, fuel, electricity) via CBS StatLine.

[![Apify Store](https://img.shields.io/badge/Apify-Store-brightgreen)](https://apify.com/store)
[![Pay Per Event](https://img.shields.io/badge/Pricing-Pay%20Per%20Event-blue)](https://apify.com/pricing)
[![License](https://img.shields.io/badge/License-Apache%202.0-orange)](LICENSE)

---

### Why This Actor?

The European Commission publishes weekly/monthly agricultural market prices (dairy, cereals, beef,
sugar) through the free, public **Agri-food Data Portal API** — but each category has its own
endpoint, its own field names, and even its own number formatting (comma vs. dot decimals). Manually
checking the Commission's dashboards, or writing your own integration against 4 slightly different
sub-APIs, wastes time.

Existing tender/commodity actors on the Apify Store overwhelmingly use **USDA (US) data sources**.
This actor is built specifically around the **EU** source, filling a gap for anyone who needs
EU/NL-relevant agri-commodity prices rather than US market data.

---

### When should an AI agent use this?

Use this actor when a user asks an AI agent questions like:

- "What's the current EU butter and skimmed milk powder price?"
- "How has the Dutch feed wheat price at Rotterdam moved over the last few weeks?"
- "Get me this week's beef prices (young bulls, cows, heifers) for the Netherlands."
- "What's the current EU average sugar price by region?"
- "Compare Dutch fertilizer and diesel input prices to last year."
- "Set up a weekly check on EU dairy/cereal prices so I don't have to check the Commission dashboards."

---

### What this Actor does

- Fetches **dairy** (butter, WMP, SMP), **cereal** (feed wheat, feed maize, per market), **beef**
  (young cattle, heifers, cows, per category), **sugar** (EU average + regional), **pigmeat**,
  **sheep & goat** (lamb), **olive oil**, **wine**, and **fruit & vegetable** prices from the
  European Commission's Agri-food Data Portal.
- Normalizes all 9 categories — each with its own native field schema — into one consistent output
  record, including a `pricePerTonne` field so mass-based categories (everything except wine, which is
  quoted per hectoliter) are directly comparable across categories.
- Optionally adds Dutch agricultural **input** prices (fertilizer, fuel, electricity) from CBS
  StatLine table 86337NED, for a farm-cost angle alongside market output prices.
- Filters by member state (where the source supports it) and year range.
- No scraping — both sources are official, documented, authentication-free public APIs.

---

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `categories` | `string[]` | `["dairy","cereal","beef","sugar"]` | Which EU Agri-food categories to fetch — also available: `pigmeat`, `sheepAndGoat`, `oliveOil`, `wine`, `fruitAndVegetable` |
| `memberStates` | `string[]` | `["NL"]` | ISO country codes, e.g. `["NL","BE","DE"]`. Leave empty for all available. No effect on `sugar` (see note below) |
| `yearFrom` | `integer` | current year | Earliest year to fetch. Must not be greater than `yearTo` (rejected with a validation error) |
| `yearTo` | `integer` | current year | Latest year to fetch |
| `includeCbs` | `boolean` | `false` | Also fetch NL agri-input prices (fertilizer/fuel/electricity) from CBS |
| `maxResults` | `integer` | `500` | Max total price records returned (1–5000) |
| `productFilter` | `string` | none | Only return records whose `product` field contains this text (case-insensitive), e.g. `"butter"`. Leave empty for no filter |
| `berekenTrends` | `boolean` | `false` | Add a period-over-period change field, calculated from the already-fetched period range |
| `alertOpDrempel` | `boolean` | `false` | Compare each product's price with the previous run and flag a significant change |
| `alertDrempelPercentage` | `integer` | `5` | Minimum absolute % change vs. the previous run to count as a `price-alert` |

**Note on `sugar`**: the EU Agri-food Data Portal's sugar endpoint has no per-member-state
breakdown — it only reports an EU average plus numbered regions (confirmed via live API testing).
`memberStates` therefore has no effect on sugar results; use the `market` field to see the
region/average instead.

---

### Output

Each price is pushed to the dataset as a normalized JSON object:

```json
{
  "source": "eu_agrifood",
  "category": "dairy",
  "product": "BUTTER",
  "memberState": "NL",
  "market": null,
  "price": 375,
  "priceRaw": "€375.00",
  "unit": "100KG",
  "pricePerTonne": 3750,
  "period": "2026-06-29/2026-07-05",
  "sourceUrl": "https://agridata.ec.europa.eu/extensions/DashboardMilk/MilkProductPrices.html",
  "vorigePeriodePrice": null,
  "periodeVeranderingPercentage": null,
  "trendBeschikbaar": false,
  "vorigeRunPrice": null,
  "vorigeRunVeranderingPercentage": null,
  "priceAlertDrempelOverschreden": false
}
````

#### Fetch robustness

A failed fetch for one year/category (e.g. a temporary 5xx from the source) no longer fails the whole run —
it's logged as a warning and the run continues with the remaining years/categories, so data already fetched in
the same run isn't lost. If any warnings occurred, they're written to the actor's key-value store under
`FETCH_WARNINGS` (visible in the Apify Console run's storage tab) and printed to the run log.

#### Trend fields (`berekenTrends`, optional, separately charged)

With `berekenTrends: true` (typically combined with a `yearFrom`/`yearTo` range spanning multiple periods),
each record is compared with the previous period for the same source/category/product/member-state/market:
`vorigePeriodePrice` and `periodeVeranderingPercentage`. `trendBeschikbaar` is `true` only when a previous
period was actually found in the fetched range — the first period has nothing to compare against, so it stays
`false` rather than a guessed 0%. Only records with `trendBeschikbaar: true` are charged the extra
`trend-record` event.

#### Price alerts (`alertOpDrempel`, optional, separately charged)

With `alertOpDrempel: true`, each product's price is compared with the previous run (via the actor's
key-value store): `vorigeRunPrice`, `vorigeRunVeranderingPercentage`, and `priceAlertDrempelOverschreden` (true
when the absolute % change reaches `alertDrempelPercentage`, default `5`). Meant for scheduled runs — you get
a direct signal for products whose price moved significantly since last time, without re-checking every
price yourself. Only alerted records are charged the extra `price-alert` event.

#### Alert streaks (`trackAlertStreak`, optional, separately charged)

With `alertOpDrempel: true` and `trackAlertStreak: true`, each group also gets `alertStreak` (the number of
consecutive runs, including this one, that crossed the threshold in the same direction) and
`alertStreakRichting` (`"omhoog"`/`"omlaag"`/`null`). A single one-off price spike looks the same as before
(`alertStreak: 1`), but a sustained trend across multiple scheduled runs is now visible directly instead of
requiring you to compare runs yourself. The extra `alert-streak-signaal` event is only charged once a streak
of 2 or more is actually detected.

#### Farm-margin indicator (`berekenMargeIndicator`, optional, separately charged)

With `berekenMargeIndicator: true` (requires both a `dairy` category and `includeCbs: true`), one extra
dataset item is added at the end of the run — the ratio of the average EU dairy price to the CBS fertilizer
price ("Kunstmest"), a rough farm-margin proxy:

```json
{
  "type": "marge-indicator",
  "jaar": "2026",
  "gemiddeldeMelkprijs": 350,
  "melkprijsEenheid": "100KG",
  "kunstmestPrijs": 50,
  "kunstmestEenheid": "",
  "ratio": 7
}
```

Only added (and charged as the new `margin-record` event) when both a dairy price and a CBS fertilizer price
are actually available in the same run — otherwise there's nothing to compare and no record is produced.

A cereal example (with a `market` field, which dairy/beef don't have):

```json
{
  "source": "eu_agrifood",
  "category": "cereal",
  "product": "Feed wheat",
  "memberState": "NL",
  "market": "National Average",
  "price": 216.5,
  "priceRaw": "€216,50",
  "unit": "TONNES",
  "period": "2026-06-29/2026-07-05",
  "sourceUrl": "https://agridata.ec.europa.eu/extensions/DashboardCereals/CerealsPrices.html"
}
```

#### Field Reference

| Field | Type | Description |
|---|---|---|
| `source` | string | `"eu_agrifood"` or `"cbs"` |
| `category` | string | `"dairy"`, `"cereal"`, `"beef"`, `"sugar"`, `"pigmeat"`, `"sheepAndGoat"`, `"oliveOil"`, `"wine"`, `"fruitAndVegetable"` or `"input"` (CBS only) |
| `product` | string | Product/category name, e.g. `"BUTTER"`, `"Feed wheat"`, `"Young cattle"`, `"Elektriciteit"` |
| `memberState` | string | null | ISO country code. Always `null` for `sugar` and non-`NL` CBS rows aren't fetched |
| `market` | string | null | Market/region name where the source has one (cereal markets, sugar regions, olive oil/fruit-veg markets). `null` otherwise |
| `price` | number | null | Parsed numeric price. `null` if the source value couldn't be parsed |
| `priceRaw` | string | The original price string as returned by the source, e.g. `"€216,50"` |
| `unit` | string | Price unit, e.g. `"100KG"`, `"TONNES"`, `"€/100Kg"` |
| `pricePerTonne` | number | null | Price converted to a fixed per-tonne basis, so mass-based categories are directly comparable. `null` when the unit isn't mass-based (e.g. wine per hectoliter) or unrecognized — never a guess |
| `period` | string | ISO date range (`"YYYY-MM-DD/YYYY-MM-DD"`), ISO month (`"YYYY-MM"`, sugar) or year (`"YYYY"`, CBS) |
| `sourceUrl` | string | Link to the relevant European Commission dashboard or CBS StatLine table |
| `alertStreak` | number | null | Only with `trackAlertStreak`: consecutive same-direction threshold crossings, including this run. `null` when the feature is off |
| `alertStreakRichting` | string | null | `"omhoog"`/`"omlaag"`/`null` — direction of the active streak |

***

### Use cases

- **Agricultural procurement / trading**: track weekly EU dairy, cereal and beef prices without
  manually checking Commission dashboards.
- **Farm cost monitoring (NL)**: combine market output prices with CBS input cost data
  (`includeCbs: true`) to track margin pressure.
- **Market research / journalism**: quote official EU price benchmarks in reports.
- **AI agents / MCP tooling**: structured price data as context for market-analysis or
  procurement-advisory agents.

***

### Pricing

This Actor uses Apify's Pay-Per-Event (PPE) pricing model.

- **Actor Start:** $0.00005 (Apify default)
- **`price-record`:** $0.004 per price record returned
- **`trend-record`:** $0.008 extra, only with `berekenTrends` enabled and only when a previous-period
  comparison was actually found
- **`price-alert`:** $0.015 extra, only with `alertOpDrempel` enabled and only when the price change vs. the
  previous run reaches the threshold
- **`alert-streak-signaal`:** $0.01 extra, only with `alertOpDrempel` + `trackAlertStreak` enabled and only
  when a same-direction streak of 2 or more runs is actually detected
- **`margin-record`:** $0.006, only with `berekenMargeIndicator` enabled and only when both a dairy price and
  a CBS fertilizer price are available in the same run

***

### Legal

- **EU Agri-food Data Portal**: official European Commission (DG AGRI) service, explicitly built and
  documented as a public API for reuse of market data. No authentication or scraping involved.
- **CBS StatLine**: official Dutch government open data (OData), same reuse policy as other Dutch
  government sources.
- No personal data is processed — all data is aggregate market/region-level pricing, not
  individual businesses or people.

***

### FAQ

**How fresh is the data?**
The EU Agri-food Data Portal publishes dairy/beef weekly and cereal/sugar monthly-to-weekly
depending on category. Every run fetches live from the source — there is no caching layer.

**Why is `memberState` sometimes `null`?**
The sugar endpoint reports an EU average plus numbered regions, not a per-country breakdown — this
is a limitation of the source API itself, confirmed via live testing, not a bug in this actor.

**What does `includeCbs` add?**
Dutch agricultural input prices (fertilizer, fuel, electricity) from CBS StatLine table 86337NED,
useful for a farm-cost angle alongside the EU market output prices. Only the most recent annual
figures are returned (this CBS table publishes yearly, not real-time).

**Are there rate limits?**
Neither source publishes explicit rate-limit headers. This actor adds a small delay between
requests to the EU Agri-food API as a conservative precaution.

***

### Related Actors

Also by this developer:

- **[Shopify Product & Price Monitor](https://apify.com/codeclouds/shopify-price-monitor)** — same profile: a change-detection price-monitoring feed with alert thresholding, for Shopify store products instead of EU agricultural commodities.

***

### Keywords

agriculture, agri, commodity-prices, dairy, cereal, beef, sugar, pigmeat, sheep, goat, olive oil,
wine, fruit, vegetable, eu-open-data, cbs, netherlands, farming, market-data

***

### Changelog

#### 0.5.0

- Added `trackAlertStreak`: signals when a group crosses the price-alert threshold in the same direction
  across multiple consecutive runs (`alertStreak`/`alertStreakRichting`), instead of only a single-run alert.
  New charged event `alert-streak-signaal` ($0.01), only when a streak of 2 or more is detected. Confirmed by
  the user (2026-07-16).
- Added `berekenMargeIndicator`: a farm-margin-indicator dataset item (ratio of average EU dairy price to CBS
  fertilizer price). New charged event `margin-record` ($0.006), only when both source prices are available
  in the same run. Confirmed by the user (2026-07-16).

#### 0.4.0

- Added 5 new EU Agri-food categories: `pigmeat`, `sheepAndGoat`, `oliveOil`, `wine`, `fruitAndVegetable` —
  same normalization pattern as the existing 4 categories. No pricing change.
- Added a `pricePerTonne` output field: a fixed conversion table normalizes mass-based units (`100KG`, `KG`,
  `TONNES`) to a per-tonne basis so categories with different native units are directly comparable. `null`
  for non-mass-based units (e.g. wine per hectoliter) — never a guessed value. Applied to EU Agri-food and CBS
  records alike. No pricing change.
- Added a Zod validation rejecting `yearFrom > yearTo`, which previously silently returned 0 EU Agri-food
  records with no explanation.
- A failed fetch for one year/category no longer fails the whole run: the error is logged as a warning
  (written to the key-value store under `FETCH_WARNINGS`) and the run continues with the remaining
  years/categories, so already-fetched data in the same run isn't lost.

#### 0.3.1 - Bugfix

- Fixed `price-alert` never firing across scheduled runs: the actor was reading/writing its snapshot to
  Apify's per-Run *default* key-value store, which is not shared between separate runs — so the "previous run"
  comparison always came back empty. Now uses a named, persistent key-value store. If you use `alertOpDrempel`,
  a new baseline will be captured on the next run.

#### 0.3.0

- Added `berekenTrends`: period-over-period % change, calculated from the fetched period range. New charged
  event `trend-record` ($0.008).
- Added `alertOpDrempel`/`alertDrempelPercentage`: compares each product's price with the previous run and
  flags a significant change. New charged event `price-alert` ($0.015).
- Both confirmed by the user (2026-07-14, see docs/actor-verbeteringen/PRIJSBESLISSINGEN.md).

#### 0.2.0

- Added `productFilter` (case-insensitive substring match on the `product` field) so users can request e.g.
  only butter prices instead of the full dairy category. No pricing change.

#### 0.1.0

- Initial release: dairy, cereal, beef, sugar from the EU Agri-food Data Portal, optional CBS
  Landbouwprijzen (input costs) add-on.

# Actor input Schema

## `categories` (type: `array`):

Which EU Agri-food Data Portal categories to fetch.

## `memberStates` (type: `array`):

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).

## `yearFrom` (type: `integer`):

Earliest year to fetch, e.g. 2024. Leave empty to only fetch the current year.

## `yearTo` (type: `integer`):

Latest year to fetch, e.g. 2026. Leave empty to only fetch the current year.

## `includeCbs` (type: `boolean`):

Also fetch Dutch agricultural input prices (fertilizer, fuel, electricity) from CBS StatLine table 86337NED. Adds items with source "cbs".

## `maxResults` (type: `integer`):

Maximum number of price records to return in total across all categories/sources (1-5000).

## `productFilter` (type: `string`):

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` (type: `boolean`):

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.

## `alertOpDrempel` (type: `boolean`):

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.

## `alertDrempelPercentage` (type: `integer`):

Minimum absolute percentage change vs. the previous run to count as a price-alert. Only relevant when 'Alert on significant price change' is enabled.

## `berekenMargeIndicator` (type: `boolean`):

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.

## `trackAlertStreak` (type: `boolean`):

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.

## Actor input object example

```json
{
  "categories": [
    "dairy",
    "cereal",
    "beef",
    "sugar"
  ],
  "memberStates": [
    "NL"
  ],
  "includeCbs": false,
  "maxResults": 500,
  "berekenTrends": false,
  "alertOpDrempel": false,
  "alertDrempelPercentage": 5,
  "berekenMargeIndicator": false,
  "trackAlertStreak": false
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("codeclouds/agrigrondstofprijzen-monitor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("codeclouds/agrigrondstofprijzen-monitor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call codeclouds/agrigrondstofprijzen-monitor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=codeclouds/agrigrondstofprijzen-monitor",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
