# Sweden Riksdag Documents Scraper (`parseforge/sweden-riksdag-scraper`) Actor

Scrapes Swedish Parliament documents by search term and returns each document as a flat row with full text, type, date, and committee.

- **URL**: https://apify.com/parseforge/sweden-riksdag-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $19.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#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

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

### Sweden Riksdag Documents Scraper

**Scrape Swedish Parliament documents by any search term, up to a million per run.** Each document comes with its full text, type, date, and committee. No login or API key. Export to CSV, JSON, Excel, or XML.

The Riksdag's official website lets you search documents, but not download them in bulk. This Actor queries the public document API directly, so you can pull every motion, report, and written question that matches a keyword like klimat or skatt, without writing any code.

| Who uses it | What they scrape Sweden Riksdag for |
|---|---|
| Policy analysts | Track how a specific issue is being debated in the Swedish Parliament |
| Journalists | Find motions and reports on a topic for a story |
| NGOs and advocacy groups | Monitor legislative activity relevant to their cause |
| Researchers | Build a corpus of parliamentary documents for text analysis |

### What it does

This Actor collects Swedish Parliament documents by search term and returns each one as a flat row.

- 🔍 **Keyword search:** enter any Swedish term, like energi or migration, and get every matching document.
- 📄 **Full text included:** each result contains the complete document text, not a summary.
- 📊 **Structured output:** documents are returned as flat rows with type, date, committee, and more.
- ⚡ **Scalable:** collect up to 1,000,000 documents in a single run.

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

### What you can do with Sweden Riksdag data

**📈 Track legislative trends.**

A policy analyst runs the Actor weekly with the term 'klimat' to see new motions and reports, then charts how often climate is discussed over time.

**📰 Investigate a story.**

A journalist searches for 'skatt' to find all recent tax-related documents, then reads the full texts to identify key proposals.

**🎓 Build a research dataset.**

A university researcher collects thousands of documents on 'migration' to train a text classifier or run sentiment analysis.

**📢 Monitor for advocacy.**

An NGO sets up a scheduled run for 'energi' to get alerts whenever a new energy policy document is published.

### Why choose this scraper

| | What you get |
|---|---|
| **No API key** | Uses the public Riksdag document API, so you can start immediately |
| **Full text search** | Finds documents that mention your keyword anywhere in the body |
| **Bulk export** | Get all results in one dataset, ready for analysis |
| **Swedish source** | Covers all document types from the Swedish Parliament |

### How it compares

No other Store actor targets Sweden Riksdag the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Sweden Riksdag Documents Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Sweden Riksdag 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 single search term. The query matches document titles and full text, and the maxItems limit controls how many documents are returned. The Input tab lists every parameter.

A first run with the defaults:

```json
{
 "searchQuery": "klimat",
 "maxItems": 10
}
```

A larger pull:

```json
{
 "searchQuery": "klimat",
 "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.021 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $2.10 |
| 1,000 results | $21.00 |
| 10,000 results | $210.00 |

New Apify accounts start with $5 in free credit.

### 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 [Sweden Riksdag Documents Scraper](https://apify.com/parseforge/sweden-riksdag-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 Sweden Riksdag 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/sweden-riksdag-scraper"
```

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

### Troubleshooting

**Why am I getting no results?**

Check your search term. It must be a Swedish word or phrase that appears in document titles or full text. Try a broader term like 'klimat' instead of a very specific phrase.

**The run is taking too long.**

Lower the maxItems value. The Actor processes documents sequentially, so a high limit can take time. You can also run multiple queries in parallel.

**Some documents are missing full text.**

Occasionally the Riksdag API does not provide full text for certain document types. The Actor will still return the metadata, but the text field may be empty.

**I get an error about invalid search term.**

Make sure the searchQuery is a non-empty string without special characters. Avoid using quotes or operators; a simple keyword.

### FAQ

| Question | Answer |
|---|---|
| What types of documents does this scrape? | It returns all document types available on the Riksdag website, including motions, committee reports, written questions, and interpellations. |
| Can I search in English? | The search works best with Swedish keywords, since documents are primarily in Swedish. Some documents may have English summaries, but the full text is usually Swedish. |
| Is there a rate limit? | The Actor respects the Riksdag API's rate limits and handles retries automatically. You can set maxItems to control the volume. |
| How do I get the full text of each document? | The full text is included in the output as a field, so you can read or analyze it directly from the dataset. |
| Can I filter by date or document type? | Currently the Actor only filters by search term. You can post-process the results in your dataset to filter by date or type. |
| What format is the output? | The Actor returns a flat JSON array, which you can export to CSV, Excel, JSON, or XML from the Apify platform. |
| Do I need an API key for the Riksdag? | No, the Actor uses the public API endpoint without authentication. |
| Can I schedule this to run automatically? | Yes, you can set up a schedule in Apify to run the Actor daily, weekly, or at any interval. |

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

## `searchQuery` (type: `string`):

Required. Keyword to search Swedish Parliament documents (for example klimat, skatt, energi). Matches document titles and full text.

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

Maximum number of Riksdag documents to collect per run.

## Actor input object example

```json
{
  "searchQuery": "klimat",
  "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 = {
    "searchQuery": "klimat",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/sweden-riksdag-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 = {
    "searchQuery": "klimat",
    "maxItems": 10,
}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/sweden-riksdag-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/5XWkZgWWfVjBIftFm/builds/Ei4CgrwK9cxnKRpir/openapi.json
