# Blocket.se Scraper | Swedish Classifieds Marketplace (`longanimous_bracken/blocket-se-scraper`) Actor

Scrape Blocket.se (Swedish marketplace). Extracts title, price, location, image, item ID. Optional detail pages for description, condition, brand, category path. Multi-page pagination, price/region filters, CSV/JSON output.

- **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, Automation, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.01 / 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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
- 2 GB RAM allocation (PlaywrightCrawler)

### Notes

- Region filtering is applied **post-extraction** (Blocket.se strips URL filter params)
- Detail fields are `null` when `fetchDetails: false`
- The `condition` field is mapped from schema.org (`NewCondition` → "Kuin uusi", `UsedCondition` → "Käytetty")

### 💬 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.0.6 | 2026-07-15 | Added AI assistant prompt block, enriched README, updated actor title with keywords |
| 0.0.5 | 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 |

# 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Blocket.se Scraper | Swedish Classifieds Marketplace",
        "description": "Scrape Blocket.se (Swedish marketplace). Extracts title, price, location, image, item ID. Optional detail pages for description, condition, brand, category path. Multi-page pagination, price/region filters, CSV/JSON output.",
        "version": "0.0",
        "x-build-id": "aUkzQSHDmMBclAMEF"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/longanimous_bracken~blocket-se-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-longanimous_bracken-blocket-se-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/longanimous_bracken~blocket-se-scraper/runs": {
            "post": {
                "operationId": "runs-sync-longanimous_bracken-blocket-se-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/longanimous_bracken~blocket-se-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-longanimous_bracken-blocket-se-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "searchQuery": {
                        "title": "Search Query",
                        "type": "string",
                        "description": "Search term — Swedish or English keywords (e.g. 'iphone', 'lägenhet', 'cykel').",
                        "default": "iphone"
                    },
                    "maxPages": {
                        "title": "Max Pages",
                        "type": "integer",
                        "description": "Number of search result pages to scrape (~30 listings per page). Default: 1.",
                        "default": 1
                    },
                    "priceMin": {
                        "title": "Minimum Price (kr)",
                        "type": "integer",
                        "description": "Minimum price in SEK. Applied post-extraction."
                    },
                    "priceMax": {
                        "title": "Maximum Price (kr)",
                        "type": "integer",
                        "description": "Maximum price in SEK. Applied post-extraction."
                    },
                    "regions": {
                        "title": "Regions",
                        "type": "array",
                        "description": "Filter by one or more Swedish regions/län (counties). Leave empty for all regions. Examples: Stockholm, Västra Götaland, Skåne, Uppsala.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "sort": {
                        "title": "Sort Order",
                        "type": "string",
                        "description": "Sort order: relevance, newest, cheapest, most_expensive.",
                        "default": "relevance"
                    },
                    "fetchDetails": {
                        "title": "Fetch Detail Pages",
                        "type": "boolean",
                        "description": "Visit each listing's detail page to extract description, brand, condition, images, category path, and dates. Adds ~2-5s per listing.",
                        "default": false
                    },
                    "detailDelaySecs": {
                        "title": "Detail Page Delay (seconds)",
                        "type": "integer",
                        "description": "Delay between detail page visits. Jitter (±25%) is added automatically. Only relevant when fetchDetails is true.",
                        "default": 2
                    },
                    "outputFormat": {
                        "title": "Output Format",
                        "type": "string",
                        "description": "Output format: dataset, csv, json, or all.",
                        "default": "dataset"
                    },
                    "webhookUrl": {
                        "title": "Webhook URL",
                        "type": "string",
                        "description": "HTTPS URL to POST all listings to on completion."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
