# Statistics Denmark Statbank Scraper (`parseforge/statbank-denmark-v2-scraper`) Actor

Scrapes records from a specified Statbank table on statbank.dk and returns each row as a flat object with all dimensions and values.

- **URL**: https://apify.com/parseforge/statbank-denmark-v2-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Developer tools, Business, Education
- **Stats:** 2 total users, 1 monthly users, 89.7% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Statistics Denmark Statbank Scraper

**Scrape any table from Statistics Denmark's Statbank, up to a million records per run.** Each row comes with all dimensions and values, ready for analysis. No API key or registration. Export to CSV, JSON, Excel, or XML.

Statistics Denmark's official API requires a subscription and complex queries. This reads the public Statbank tables directly, by table ID, and returns every record in a flat, consistent schema. Filter by maximum records to control the size of your dataset.

| Who uses it | What they scrape Statistics Denmark Statbank for |
|---|---|
| Economists | Pull CPI, GDP, or employment tables for time-series analysis. |
| Data journalists | Get population or housing data to support stories with official numbers. |
| Market researchers | Analyze demographic trends from census or migration tables. |
| Policy analysts | Monitor social indicators like unemployment or education statistics. |

### What it does

This Actor collects records from a specified Statbank table and returns each one as a flat row with all dimensions and values.

- 📊 **Any Statbank table:** provide a table ID like PRIS9 for CPI or FOLK1A for population.
- 🔢 **Up to a million records:** set maxItems to collect as many rows as you need.
- 📁 **Structured output:** each record is a flat object with all dimensions and values.
- ⚡ **No API key:** the Actor reads the public Statbank interface directly.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Statistics Denmark Statbank data

**📈 Track inflation over time.**

An economist runs the Actor with table ID PRIS9 to collect annual CPI data and builds a trend chart for a report.

**🗺️ Map population changes.**

A data journalist scrapes FOLK1A to get population by municipality and creates an interactive map for a news article.

**🏠 Analyze housing statistics.**

A market researcher pulls housing construction data to identify regional growth patterns for a client presentation.

**🎓 Study education outcomes.**

A policy analyst collects education attainment tables to evaluate the impact of a new program.

### Why choose this scraper

|  | What you get |
|---|---|
| **Official data** | Directly from Statistics Denmark's public Statbank. |
| **Flexible tables** | Scrape any table by its ID, from CPI to population. |
| **Large volume** | Collect up to one million records per run. |
| **Clean schema** | Every record is a flat object, ready for analysis. |

### How it compares

No other Store actor targets Statistics Denmark Statbank the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Statistics Denmark Statbank Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Statistics Denmark Statbank changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor with a Statbank table ID and a maximum record count. The table ID selects which dataset to scrape, and maxItems limits how many rows are returned. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "tableId": "PRIS9",
  "maxItems": 10
}
```

A larger pull:

```json
{
  "tableId": "PRIS9",
  "maxItems": 200
}
```

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Statistics Denmark Statbank Scraper](https://apify.com/parseforge/statbank-denmark-v2-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Statistics Denmark Statbank through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/statbank-denmark-v2-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting no results?**

Check that the table ID is correct and that the table has data. Some tables may be empty or require specific parameters.

**The run fails with an error.**

Verify the table ID. If it is correct, the table might be temporarily unavailable. Try again later.

**I only got a few records but expected more.**

Increase the maxItems value. The default is 10, but you can set it up to 1,000,000.

**The output has strange characters.**

The data may include Danish characters. Ensure your downstream tool handles UTF-8 encoding.

### FAQ

| Question | Answer |
|---|---|
| What is a Statbank table ID? | It is the unique identifier for a dataset on Statistics Denmark's Statbank, such as PRIS9 for annual consumer price index or FOLK1A for population. You can find it in the table's URL or metadata. |
| Do I need an API key? | No. The Actor reads the public Statbank interface directly, so no registration or key is required. |
| How many records can I get? | You can set maxItems up to 1,000,000 records per run. The actual number depends on the table size. |
| What format is the output? | Each record is a flat JSON object with all dimensions and values. You can export the dataset to CSV, JSON, Excel, or XML. |
| Can I scrape multiple tables at once? | This Actor scrapes one table per run. To scrape multiple tables, run it multiple times with different table IDs. |
| Is the data in English or Danish? | The data comes as published by Statistics Denmark. Some tables have English labels, others Danish. The Actor returns the raw values. |
| How do I find the table ID? | Go to statbank.dk, find the table you want, and look at the URL or the table information. The ID is usually a short code like PRIS9. |
| Can I filter by specific dimensions? | This Actor returns all rows for the table up to maxItems. For dimension filtering, you would need to process the output or use a different tool. |
| Is there a rate limit? | The Actor is designed to be respectful of the source. If you need many records, consider increasing maxItems gradually. |
| What if the table ID is wrong? | The run will fail with an error. Check the ID on statbank.dk and try again. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Statistics Denmark. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `tableId` (type: `string`):

Statbank table id (e.g. PRIS9 for annual CPI, FOLK1A for population).

## `maxItems` (type: `integer`):

How many statistics records to collect per run.

## Actor input object example

```json
{
  "tableId": "PRIS9",
  "maxItems": 10
}
```

# Actor output Schema

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

No description

# 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 = {
    "tableId": "PRIS9",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/statbank-denmark-v2-scraper").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 = {
    "tableId": "PRIS9",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/statbank-denmark-v2-scraper").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 '{
  "tableId": "PRIS9",
  "maxItems": 10
}' |
apify call parseforge/statbank-denmark-v2-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/statbank-denmark-v2-scraper"
        }
    }
}

```

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/G9Q4gnDOrWmiRgkga/builds/cZdf6ykkygDCv9KI2/openapi.json
