# Blocket.se MCP Server — Swedish Marketplace for AI (`longanimous_bracken/blocket-se-scraper`) Actor

MCP Server for Blocket.se. Search Swedish marketplace listings. AI-agent ready — returns prices, locations, and item details.

- **URL**: https://apify.com/longanimous\_bracken/blocket-se-scraper.md
- **Developed by:** [petteri mähönen](https://apify.com/longanimous_bracken) (community)
- **Categories:** E-commerce, MCP servers
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.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.

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

## Blocket.se Scraper

Scrape **Blocket.se**, Sweden's largest classifieds marketplace. Extracts listing titles, prices, locations, and images from search results. Optionally crawls detail pages for full descriptions, condition, brand, and category data.

### Features

- **Search result extraction** — title, price, location, image URL, item ID
- **Detail page extraction** — description, condition, brand, category path, all images
- **Multi-page pagination** — scrape multiple pages of results
- **Price filtering** — filter by min/max price (SEK)
- **Region filtering** — filter by Swedish county (län)
- **Sort options** — relevance, newest, cheapest, most expensive
- **Output formats** — dataset, CSV, JSON, or all
- **Webhook delivery** — POST results to your webhook URL on completion
- **Anti-detection** — stealth mode, random delays with jitter

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `searchQuery` | string | `"iphone"` | Search term |
| `maxPages` | number | `1` | Number of search pages to scrape |
| `priceMin` | number | — | Minimum price in SEK |
| `priceMax` | number | — | Maximum price in SEK |
| `regions` | stringList | — | Filter by Swedish counties |
| `sort` | select | `relevance` | Sort: relevance, newest, cheapest, most\_expensive |
| `fetchDetails` | checkbox | false | Visit detail pages for extra data |
| `detailDelaySecs` | number | `2` | Delay between detail page visits |
| `outputFormat` | select | `dataset` | Output: dataset, csv, json, all |
| `webhookUrl` | string | — | Webhook URL for POST delivery |

### Output

Each listing includes:

| Field | Source |
|---|---|
| `title` | Search results |
| `price` | Search results (formatted, e.g. "6 500 kr") |
| `price_numeric` | Search results (parsed, e.g. 6500) |
| `location` | Search results |
| `region` | Search results |
| `url` | Search results |
| `image_url` | Search results |
| `item_id` | Search results |
| `search_query` | Input |
| `page_number` | Search results |
| `scraped_at` | ISO timestamp |
| `description` | Detail page (if `fetchDetails: true`) |
| `condition` | Detail page (NewCondition → "Kuin uusi") |
| `brand` | Detail page (e.g. "Apple") |
| `category_path` | Detail page (breadcrumb) |
| `images` | Detail page (array of URLs) |

### Example

```json
{
  "searchQuery": "iphone",
  "maxPages": 2,
  "sort": "newest",
  "priceMin": 1000,
  "priceMax": 10000,
  "regions": ["Stockholm", "Västra Götaland"],
  "fetchDetails": true,
  "outputFormat": "all"
}
```

### Performance

- \~30 listings per search page
- \~1-2 seconds per search page
- \~2 seconds per detail page visit
- PlaywrightCrawler (JS-rendered marketplace)

### Notes

- Region filtering is applied **post-extraction** (Blocket.se strips URL filter params)
- Detail fields are `null` when `fetchDetails: false`
- For large scrapes (10+ pages), consider using the `all` output format for CSV/JSON backup

### Pricing

**Pay per event** — charged per listing extracted.

### 💬 Quick Start for AI Assistants

Copy and paste this into ChatGPT, Claude, or another AI assistant to get help using this actor:

***

You are helping me use the "Blocket.se Scraper" on Apify (actor ID: dpxoWnzoNLSJeWH4n). It extracts listings from blocket.se, Sweden's largest classifieds marketplace.

Input fields:

- searchQuery: string, e.g. "iphone"
- maxPages: number, pages to scrape (default: 1)
- priceMin, priceMax: number, filter by SEK (default: none)
- regions: string array, e.g. \["Stockholm", "Västra Götaland"]
- sort: string, "relevance" | "newest" | "cheapest" | "most\_expensive"
- fetchDetails: boolean, visit detail pages for descriptions, condition, brand
- detailDelaySecs: number, seconds between detail visits (default: 2)
- outputFormat: "dataset" | "csv" | "json" | "all"
- webhookUrl: string, optional HTTPS URL for POST delivery

Output fields: title, price, price\_numeric, location, region, url, image\_url, item\_id, search\_query, page\_number, scraped\_at + detail fields (description, condition, brand, category\_path, images).

## Help me with the right input, output processing, or troubleshooting.

### 📋 Changelog

| Version | Date | Changes |
|---------|------|---------|
| 0.2 | 2026-07-15 | Added AI assistant prompt block, enriched README, updated actor title with keywords |
| 0.1 | 2026-07-15 | Multi-page pagination working — 30 listings across 3 pages (Stockholm + Göteborg), 0 errors, 17s runtime |
| 0.0.1 | 2026-07-13 | Initial release — Blocket.se listing extraction with PlaywrightCrawler |

***

### Support & Feedback

**Enjoying this Actor?** [Leave a review on Apify Store](https://apify.com/longanimous_bracken/blocket-se-scraper/reviews) — it helps others discover the tool.

Found a bug or have a feature request? [Open an issue](https://console.apify.com/actors/dpxoWnzoNLSJeWH4n/issues) on the Actor page.

# Actor input Schema

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

Search term — Swedish or English keywords (e.g. 'iphone', 'lägenhet', 'cykel').

## `maxPages` (type: `integer`):

Number of search result pages to scrape (~30 listings per page). Default: 1.

## `priceMin` (type: `integer`):

Minimum price in SEK. Applied post-extraction.

## `priceMax` (type: `integer`):

Maximum price in SEK. Applied post-extraction.

## `regions` (type: `array`):

Filter by one or more Swedish regions/län (counties). Leave empty for all regions. Examples: Stockholm, Västra Götaland, Skåne, Uppsala.

## `sort` (type: `string`):

Sort order: relevance, newest, cheapest, most\_expensive.

## `fetchDetails` (type: `boolean`):

Visit each listing's detail page to extract description, brand, condition, images, category path, and dates. Adds ~2-5s per listing.

## `detailDelaySecs` (type: `integer`):

Delay between detail page visits. Jitter (±25%) is added automatically. Only relevant when fetchDetails is true.

## `outputFormat` (type: `string`):

Output format: dataset, csv, json, or all.

## `webhookUrl` (type: `string`):

HTTPS URL to POST all listings to on completion.

## Actor input object example

```json
{
  "searchQuery": "iphone",
  "maxPages": 1,
  "regions": [],
  "sort": "relevance",
  "fetchDetails": false,
  "detailDelaySecs": 2,
  "outputFormat": "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("longanimous_bracken/blocket-se-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("longanimous_bracken/blocket-se-scraper").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 longanimous_bracken/blocket-se-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/acts/dpxoWnzoNLSJeWH4n/builds/n6cMdHAfvoghkibWB/openapi.json
