# Fosfaat & Stikstofrechten Marktvergelijker (`codeclouds/nl-fosfaat-stikstofrechten-aggregator`) Actor

Vergelijk vraag, aanbod en prijzen van fosfaatrechten en ammoniak-/stikstofrechten over meerdere Nederlandse landbouwmarktplaatsen (Quotum.nu, Fosfaat.nu, Ammoniakrechten.nl, Prikkebord.nl) in één dataset.

- **URL**: https://apify.com/codeclouds/nl-fosfaat-stikstofrechten-aggregator.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 $2.00 / 1,000 offers

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 web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## Fosfaat- & Stikstofrechten Marktvergelijker

Verzamelt vraag-, aanbod- en prijsgegevens van Nederlandse fosfaatrechten en ammoniak-/stikstofrechten
van publieke landbouwmarktplaatsen en levert ze terug als één vergelijkbare, JSON-gestructureerde dataset.
Ondersteunde marktplaatsen:

| Bron | Type | Aggregaten | Prijzen | Regio |
|---|---|---|---|---|
| Quotum.nu | Koop & Lease + VVO | ✅ (`segment_totaal`) | ✅ numeriek €/kg | n.v.t. |
| Fosfaat.nu | VVO (fosfaatruimte) | ✅ | ✅ | n.v.t. |
| Ammoniakrechten.nl | Koop & Lease (NH₃) | ✅ | ✅ + "op aanvraag" | ✅ per provincie |
| Prikkebord.nl | Koop & Lease (mirror van Quotum.nu) | via feeds | ✅ | n.v.t. |

### Wat krijg je terug?

Zes record-typen, één dataset:

1. **`advertentie`** — één record per advertentie van een marktplaats, met bron-URL, rechttype (fosfaat /
   stikstof), categorie (koop/lease/VVO), transactie (aangeboden/gevraagd), hoeveelheid (kg),
   prijs (€/kg of `null` bij "op aanvraag"), leverbaar %, regio en listing-datum.
2. **`segment_totaal`** — totaal-aanbod, minimum-, gemiddelde-, mediaan- en maximumprijs per
   `bron + rechttype + categorie + transactie`-segment. In `monitorMode` ook `priceTrend`
   (`stijgend`/`dalend`/`stabiel`) t.o.v. eerdere runs.
3. **`segment_regio`** — dezelfde statistieken als `segment_totaal`, maar per regio (voor bronnen
   die een regio rapporteren, nu ammoniakrechten.nl). Een landelijk gemiddelde verbergt regionale
   prijsverschillen voor stikstofrechten.
4. **`kansprijs`** — een "aangeboden"-advertentie die ≥5% onder het segmentgemiddelde geprijsd is:
   het directe koopsignaal, i.p.v. dat je zelf door alle advertenties moet filteren.
5. **`marktvergelijking`** — per rechttype+categorie+transactie de gemiddelde prijs van elke bron
   naast elkaar, met goedkoopste/duurste bron en prijsspreiding (%). Alleen als ≥2 bronnen data
   hebben voor dat segment — dit is waar een aggregator meerwaarde biedt boven één marktplaats
   scrapen.
6. **`run_samenvatting`** — tellingen + foutmeldingen per bron, als laatste record (te filteren op `recordType`).

`Prikkebord.nl` is een koepelpagina die op zijn beurt feed-pagina's van Quotum.nu's `mid`s
samenbrengt; er is dus bewust overlap. We houden ze als afzonderlijke bronnen (`source`) zodat de
`segment_totaal` eerlijk per marktplaats laat zien wat die marktplaats zelf publiceert.

### Juridische kanttekening

De bronnen zijn **commerciële marktplaatsen** (Grasbaal.nl B.V. voor Quotum/Fosfaat/Ammoniak,
plus Prikkebord.nl). We scrapen:

- Alleen publiek beschikbare listing-pagina's, **niet** `/admin` of `/register` (robots.txt).
- Honneuren `robots.txt` van alle bronnen, inclusief de 10-seconde `Crawl-delay` van het
  Grasbaal-platform.
- Alleen feitelijke aanbodvelden — geen merktekens, eigen analyses of auteursrechtelijk
  beschermde content.
- Identificerende User-Agent met verwijzing naar deze Apify-pagina, zodat de platformeigenaar ons
  kan bereiken.

De Grasbaal-algemene-voorwaarden bevatten geen expliciete clausule die automatische toegang of
extractie door publieke bezoekers verbiedt. We gaan ervan uit dat **marktoverzicht / vergelijking
van publiek getoonde aanbiedingen** onder vergelijkbare precedenten valt als prijsvergelijkers
(reeds succesvol vertegenwoordigd in dit portfolio via `shopify-price-monitor`). Bron-URL is
altijd inbegrepen zodat afnemers zelf kunnen doorklikken.

### Configuratie

Alle velden hebben defaults; een run zonder input scrapet alle 4 bronnen in beide rechttypes
met monitor-mode uit.

- `sources`: welke marktplaatsen
- `rightTypes`: alleen `fosfaat`, alleen `stikstof` of beide
- `monitorMode`: aan/uit — vergelijken met vorige run, `changeType` per record
- `onlyChanges`: in monitor-mode, alleen deltas
- `maxPagesPerSource`: veiligheidscap op paginatie
- `notificationWebhookUrl`: optionele samenvatting-webhook

### Prijzen (pay-per-event)

| Event | Tarief (PPE) |
|---|---|
| `offer` | $0.002 |
| `new-offer` | $0.005 |
| `price-change` | $0.005 |
| `removed-offer` | $0.005 |
| `segment-aggregate` | $0.004 |
| `segment-regio` | $0.004 |
| `kansprijs` | $0.006 |
| `marktvergelijking` | $0.006 |

(Prijzen worden in Apify Console ingesteld; dit zijn de aangevraagde tarieven.)

### Beperkingen / open punten

- Totaalvolume is klein (tientallen tot een paar honderd aanbiedingen per bron per scrape).
- "Op aanvraag"-prijzen worden niet als getal gerapporteerd; `priceOnRequest: true` +
  `pricePerKgEur: null` is expliciet.
- Prikkebord-feed kan in de toekomst wijzigen van structuur — unit-tests beschermen het huidige
  formaat.
- Geen authenticatie, geen headless browser nodig; eenvoudige PHP/nginx-sites zonder Akamai of
  gelijkwaardige edge-bescherming.

### Disclaimer

De gegevens zijn een momentopname van publiek beschikbare advertenties op marktplaatsen. Ze zijn
bedoeld als **marktoverzicht**, niet als transactie-advies. Controleer de bron-URL voor de
definitieve transactiecondities.

# Actor input Schema

## `sources` (type: `array`):

Welke marktplaats(en) bevraagd moeten worden. Standaard alle vier.

## `rightTypes` (type: `array`):

Beperk tot fosfaatrechten en/of stikstof-/ammoniakrechten. Standaard beide.

## `monitorMode` (type: `boolean`):

Vergelijk met de vorige run (bewaard in een aparte key-value store) en markeer nieuwe, verwijderde en in prijs gewijzigde aanbiedingen.

## `onlyChanges` (type: `boolean`):

Alleen relevant in combinatie met Monitor-mode: lever enkel new/price\_change/removed-reords, niet de ongewijzigde aanbiedingen.

## `maxPagesPerSource` (type: `integer`):

Veiligheidscap op het aantal te doorlopen listing-pagina's per marktplaats.

## `notificationWebhookUrl` (type: `string`):

Optioneel: POST een compacte run-summary naar deze URL aan het einde van de run.

## Actor input object example

```json
{
  "sources": [
    "quotum.nu",
    "fosfaat.nu",
    "ammoniakrechten.nl",
    "prikkebord.nl"
  ],
  "rightTypes": [
    "fosfaat",
    "stikstof"
  ],
  "monitorMode": false,
  "onlyChanges": false,
  "maxPagesPerSource": 50
}
```

# Actor output Schema

## `results` (type: `string`):

Alle advertenties, segment-aggregaten, regionale overzichten, kansprijzen en marktvergelijkingen in de dataset.

# 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/nl-fosfaat-stikstofrechten-aggregator").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/nl-fosfaat-stikstofrechten-aggregator").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).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/nl-fosfaat-stikstofrechten-aggregator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codeclouds/nl-fosfaat-stikstofrechten-aggregator"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/YVtQjMMeaODp2qgzU/builds/3d3lXIZ06nqRqU6TL/openapi.json
