# Danish Parliament Cases & Documents (Folketinget) (`arcuate_owl/ft-case-watch`) Actor

Cases and documents from Folketingets Åbne Data with type and status resolved to names, date and keyword filters, and an only-changed mode for daily polling.

- **URL**: https://apify.com/arcuate_owl/ft-case-watch.md
- **Developed by:** [Arcuate Owl](https://apify.com/arcuate_owl) (community)
- **Categories:** News, Business, Open source
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 case 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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Danish Parliament cases and documents

Cases from Folketingets Åbne Data, with type and status already resolved to readable
names, optionally with the documents attached to each case.

The upstream service is an OData 3.0 endpoint, open and without a key. Using it
directly means knowing that a case is a `Sag`, that `typeid` 3 means `Lovforslag`
and that you have to join `Sagstype` and `Sagsstatus` yourself to find out, that
titles arrive with newlines in them, and that timestamps carry seven fractional
digits. This Actor resolves the labels server-side in the same request and hands
back one flat record.

### What you get per case

| Field | Example |
|---|---|
| `caseId` | `106483` |
| `caseNumber` | `L 87` |
| `title` | `Forslag til lov om ændring af sundhedsloven ...` |
| `shortTitle` | `Om kronikerpakker, frit valg og befordring ...` |
| `typeId` / `typeName` | `3` / `Lovforslag` |
| `statusId` / `statusName` | `25` / `Fremsat` |
| `summary` | the official resumé, where there is one |
| `voteConclusion` | the conclusion text after a vote |
| `decision`, `decisionDate` | the decision and when it was taken |
| `lawNumber`, `lawNumberDate` | set once a bill becomes law |
| `updatedAt` | `2026-11-20T10:47:21Z` |
| `retsinformationUrl` | link to the consolidated law, where one exists |
| `odaUrl` | `https://oda.ft.dk/api/Sag(106483)` |

With `includeDocuments` on, each case also carries a `documents` array: title, dates,
attachment number, and the question text for the cases that are questions to a
minister. Documents are billed separately, so `maxDocumentsPerCase` caps both how
many you get and what they cost.

Danish text is kept as Danish. Only the keys are in English, so you can read the
output without a dictionary and still quote the source exactly.

### Only what changed

A case in Folketinget changes many times on its way through the chamber, and a
committee answer is often the thing you were waiting for. So `onlyNew` remembers each
case together with its update timestamp rather than just its id. A case you have
already received comes back when it actually changes, and not before.

The remembered list lives in a named key-value store on your own account, and each
distinct filter keeps its own, so two separate watches do not interfere.

### Filtering

Everything that changed in the last week needs no settings. Narrow it by case type
(3 for bills, 5 for motions, 10 for section 20 questions), by status, by
parliamentary session, or by text in the Danish title. The filter text is matched
case-sensitively, which is how the upstream service behaves.

The full lookup lists are open if you want ids the description does not name:

- types: `https://oda.ft.dk/api/Sagstype?$format=json`
- statuses: `https://oda.ft.dk/api/Sagsstatus?$format=json`
- sessions: `https://oda.ft.dk/api/Periode?$format=json`

### Where the data comes from

Every field is read from `https://oda.ft.dk/api/Sag`, which is Folketinget's own open
data service. Nothing is scraped. Folketinget asks callers not to burden the API, so
requests are paced and pages are kept small, smaller still when documents are
attached.

One upstream quirk worth knowing: the service silently caps `$top` at 100. Asking for
500 or 5000 returns exactly 100 rows with no error, which is an easy way to think you
have reached the end of the data. The client clamps to 100 and pages with `$skip`,
which has no ceiling, so `maxCases` can go as high as you like.

Folketinget publishes terms for reusing this data. Read them before you build
something commercial on top: they are linked from
`https://www.ft.dk/dokumenter/aabne_data`.

### Running it yourself

The source is public, and it runs locally without an Apify account:

```bash
npm install
npm test          # fast, offline, uses fixtures
npm run smoke     # hits the real oda.ft.dk API and checks our assumptions still hold
node src/main.js
```

Put your input in `storage/key_value_stores/default/INPUT.json`. To see the
pay-per-event charges, set `ACTOR_TEST_PAY_PER_EVENT=true` and
`ACTOR_USE_CHARGING_LOG_DATASET=true`, then read `storage/datasets/charging_log/`.

MIT licensed.

# Actor input Schema

## `lookbackDays` (type: `integer`):

How far back to look for cases that changed. Ignored when you set an explicit 'Changed since' date.

## `updatedSince` (type: `string`):

Only cases whose last update is after this date (YYYY-MM-DD). Overrides the look-back setting.

## `updatedUntil` (type: `string`):

Only cases whose last update is before this date (YYYY-MM-DD).

## `caseTypeIds` (type: `array`):

Folketinget case type ids. 1 UMF-del, 2 Forespørgsel, 3 Lovforslag, 4 Alm. del, 5 Beslutningsforslag, 6 Rådsmøde, 7 Kommissionsforslag, 8 Aktstykke, 9 Forslag til vedtagelse, 10 § 20-spørgsmål, 11 Redegørelse, 12 Indkaldelse af stedfortræder, 13 Statsrevisorerne. Leave empty for all types.

## `statusIds` (type: `array`):

Folketinget status ids, for example 1 Afsluttet, 2 Afgivet, 3 Forkastet. The full list is at https://oda.ft.dk/api/Sagsstatus?$format=json. Leave empty for all statuses.

## `periodIds` (type: `array`):

Restrict to one or more sessions. The list is at https://oda.ft.dk/api/Periode?$format=json. Leave empty for all periods.

## `titleContains` (type: `string`):

Only cases whose Danish title contains this text. Case-sensitive, as the upstream service matches it.

## `includeDocuments` (type: `boolean`):

Attach each case's documents, including question text where there is one. This is billed per document on top of the per-case charge, and it makes runs slower.

## `maxDocumentsPerCase` (type: `integer`):

Caps how many documents are attached to each case, which also caps what the documents can cost you.

## `onlyNew` (type: `boolean`):

Remembers each case together with its update timestamp, so a case you have already seen is delivered again only when it actually changes. Turn this on for a daily schedule.

## `stateStoreName` (type: `string`):

Only used with the only-changed mode. Change it to keep separate watchlists apart. It is a named key-value store on your own account, because the run's default store is wiped between runs.

## `maxCases` (type: `integer`):

Hard cap on delivered cases, which is also a hard cap on what the run can cost you. There is no upstream ceiling: the service pages with $skip without limit, so a full backfill of the whole archive is possible if you ask for it.

## Actor input object example

```json
{
  "lookbackDays": 7,
  "caseTypeIds": [
    3,
    5
  ],
  "titleContains": "klima",
  "includeDocuments": false,
  "maxDocumentsPerCase": 20,
  "onlyNew": false,
  "stateStoreName": "ft-case-watch-state",
  "maxCases": 100
}
```

# Actor output Schema

## `cases` (type: `string`):

Every case this run delivered, one JSON object each, with the resolved type and status and any attached documents.

# 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 = {
    "caseTypeIds": [
        3,
        5
    ],
    "titleContains": "klima"
};

// Run the Actor and wait for it to finish
const run = await client.actor("arcuate_owl/ft-case-watch").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 = {
    "caseTypeIds": [
        3,
        5,
    ],
    "titleContains": "klima",
}

# Run the Actor and wait for it to finish
run = client.actor("arcuate_owl/ft-case-watch").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 '{
  "caseTypeIds": [
    3,
    5
  ],
  "titleContains": "klima"
}' |
apify call arcuate_owl/ft-case-watch --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,arcuate_owl/ft-case-watch"
        }
    }
}
```

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/yPEQoAMJsDBUbQDXU/builds/4cfC4CdHpIF7lNQxt/openapi.json
