# Blocket.se Scraper – Cars, Electronics & Marketplace (`logiover/blocket-se-scraper`) Actor

Blocket.se unofficial API alternative. Scrape Swedish classifieds and used-car listings without login; export prices, images and seller data to JSON/CSV.

- **URL**: https://apify.com/logiover/blocket-se-scraper.md
- **Developed by:** [Logiover](https://apify.com/logiover) (community)
- **Categories:** E-commerce, Business, AI
- **Features:** Limited permissions
- **Stats:** 55 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 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?

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

## Blocket.se Scraper 🇸🇪 — Sweden's Largest Classifieds: Listings, Prices & Vehicle Data (No API)

![Apify Actor](https://img.shields.io/badge/Apify-Actor-00A67E?logo=apify\&logoColor=white) ![No API key](https://img.shields.io/badge/No%20API%20key-required-2ea44f) ![Pay per result](https://img.shields.io/badge/Pricing-Pay%20per%20result-1C7ED6) ![Classifieds](https://img.shields.io/badge/Category-Classifieds%20%C2%B7%20Marketplace-8B5CF6) ![Export](https://img.shields.io/badge/Export-JSON%20%7C%20CSV%20%7C%20Excel-F59E0B)

Extract listings from **[Blocket.se](https://www.blocket.se)** — Sweden's #1 classified-ads platform, founded in 1996 and used by millions of Swedes every month. Scrape **marketplace goods and vehicles** (cars, motorcycles, boats) across **all 21 Swedish regions** — with **price, images, seller details, GPS coordinates and vehicle-specific attributes** in clean structured JSON. This Actor calls **Blocket's own search API directly** (`recommerce` for marketplace goods, `mobility` for vehicles) for fast, complete data. **No browser, no login, no API key.**

> ### 🏆 Why this Blocket scraper?
>
> **20+ fields per listing** · **15 categories** + **21 Swedish regions** · dedicated **vehicle engine** with make / model / year / mileage / fuel / gearbox · direct API + JSON (no browser) · automatic pagination & dedup · export to JSON / CSV / Excel. The unofficial **Blocket.se API alternative** for price monitoring, used-car valuation and Swedish market research.

***

### ✨ What this Actor does / Key features

- 🛍️ **Marketplace + vehicles** — scrape general classified goods **or** cars, motorcycles and boats, each from Blocket's own endpoint.
- 🚗 **Dedicated vehicle engine** — `car` / `mc` / `boat` use Blocket's **mobility API** and return extra fields: make, model, model spec, year, mileage, fuel, gearbox and registration number.
- 🗂️ **15 categories** — cars, MC & moped, boats, electronics, furniture, fashion, sport, hobby, kids, pets, art, garden, vehicle parts and business — or leave empty to search everything.
- 🌍 **21 Swedish regions** — filter by county (Stockholm, Västra Götaland, Skåne, Uppsala…) or search all of Sweden (Hela Sverige).
- 🔎 **Keyword search** — combine a free-text query (`"Volvo V70"`, `"iPhone 15"`, `"soffa"`) with any category and region.
- 📍 **Full listing detail** — title, **price in SEK**, location, seller name & type (Privat / Företag), trade type, shipping flag, brand and **GPS latitude/longitude**.
- 🖼️ **Image galleries** — cover photo plus the full list of photo URLs per listing.
- ⚡ **Direct API extraction** — calls Blocket's `recommerce` and `mobility` search APIs as JSON; no browser, no DOM walking.
- 🔁 **Automatic pagination & dedup** — follows all pages up to your `maxResults` cap and saves each listing exactly once.
- 🛡️ **Proxy support** — Apify Proxy integration; residential recommended for large-scale runs.

### 🚀 Quick start (3 steps)

1. **Configure** — pick a **Category** and **Region** (or leave both empty for all of Sweden), and optionally add a **Search Query**. Set **Max Results**.
2. **Run** — click **Start**. The Actor paginates Blocket's search API and streams listings into your dataset.
3. **Get your data** — open the **Output** tab and export to **JSON, CSV, Excel or XML**, or pull it via the Apify API.

### 📥 Input

All fields are optional — leave everything empty to browse all of Sweden, or narrow with any combination of query, category and region.

#### Example — search a keyword across all of Sweden

```json
{
  "searchQuery": "iPhone",
  "category": "",
  "location": "",
  "maxResults": 100
}
```

#### Example — used cars in Stockholm (vehicle engine)

```json
{
  "searchQuery": "Volvo",
  "category": "car",
  "location": "0.300001",
  "maxResults": 100
}
```

#### Example — all electronics in Gothenburg

```json
{
  "searchQuery": "",
  "category": "0.93",
  "location": "0.300014",
  "maxResults": 200
}
```

#### Example — full category export (unlimited)

```json
{
  "searchQuery": "",
  "category": "car",
  "location": "",
  "maxResults": 0
}
```

| Field | Type | Description |
|-------|------|-------------|
| `searchQuery` | string | Keyword to search (e.g. `iPhone 15`, `Volvo V70`, `cykel`, `soffa`). Leave empty to browse all listings in the selected category. |
| `category` | string | Category filter. Use `car`, `mc` or `boat` for the vehicle (mobility) engine; numeric codes for marketplace categories (see table below). Empty = all listings. |
| `location` | string | Swedish region code (e.g. `0.300001` = Stockholm). Empty = all of Sweden (Hela Sverige). |
| `maxResults` | integer | Max listings to scrape and save; the Actor paginates automatically until reached. `0` = unlimited (use with care on broad queries). Default `50`. |
| `proxyConfiguration` | object | Apify Proxy settings for all requests. Residential recommended for large-scale scraping. |

<details>
<summary><b>🗂️ Category codes (click to expand)</b></summary>

| Category | `category` value |
|----------|-------------|
| 🛍️ All listings | \`\` (empty) |
| 🚗 Cars | `car` |
| 🏍️ MC & Moped | `mc` |
| ⛵ Boats | `boat` |
| 📱 Electronics & Appliances | `0.93` |
| 🛋️ Furniture & Home | `0.78` |
| 👗 Fashion (Clothing, Cosmetics, Accessories) | `0.71` |
| ⚽ Sport & Leisure | `0.69` |
| 🎸 Hobby & Entertainment | `0.86` |
| 👶 Parents & Kids | `0.68` |
| 🐾 Pets & Accessories | `0.77` |
| 🖼️ Art & Antiques | `0.76` |
| 🌱 Garden & Renovation | `0.67` |
| 🔧 Vehicle Parts & Accessories | `0.90` |
| 💼 Business | `0.91` |

> `car`, `mc` and `boat` use Blocket's dedicated vehicle (mobility) API and return extra fields like make, model, year, mileage and fuel type.

</details>

<details>
<summary><b>🌍 Swedish region codes (click to expand)</b></summary>

| Region | `location` value |
|--------|-------------|
| Hela Sverige (All Sweden) | \`\` (empty) |
| Stockholm | `0.300001` |
| Västra Götaland (Gothenburg) | `0.300014` |
| Skåne (Malmö) | `0.300012` |
| Uppsala | `0.300003` |
| Östergötland | `0.300005` |
| Södermanland | `0.300004` |
| Jönköping | `0.300006` |
| Kronoberg | `0.300007` |
| Kalmar | `0.300008` |
| Gotland | `0.300009` |
| Blekinge | `0.300010` |
| Värmland | `0.300013` |
| Västmanland | `0.300017` |
| Örebro | `0.300018` |
| Dalarna | `0.300019` |
| Gävleborg | `0.300020` |
| Västernorrland | `0.300021` |
| Jämtland | `0.300022` |
| Västerbotten | `0.300023` |
| Norrbotten | `0.300024` |

</details>

### 📤 Output

One row per listing — exportable to JSON, CSV, Excel or XML. Vehicle fields (`make`, `model`, `year`…) appear only for `car` / `mc` / `boat` ads. Here is a trimmed vehicle sample (image list truncated with `…`):

```json
{
  "id": "23047162",
  "url": "https://www.blocket.se/mobility/item/23047162",
  "title": "Volvo V90 Cross Country",
  "price": "224 800 kr",
  "location": "Bromma",
  "category": "CAR_USED",
  "sellerName": "Bilfirma AB",
  "sellerType": "Företag",
  "shipping": null,
  "brand": "Volvo",
  "imageUrl": "https://img.blocket.se/…/cover.jpg",
  "imageUrls": "https://img.blocket.se/…/1.jpg, https://img.blocket.se/…/2.jpg, …",
  "tradeType": "Säljes",
  "make": "Volvo",
  "model": "V90",
  "modelSpec": "V90 Cross Country D4 AWD",
  "year": "2019",
  "mileage": "9 200 mil",
  "fuel": "Diesel",
  "gearbox": "Automat",
  "regno": "ABC123",
  "publishedAt": "2026-05-10T14:22:00.000Z",
  "lat": "59.3415",
  "lng": "17.9389",
  "scrapedAt": "2026-05-14T09:42:46.272Z"
}
```

<details>
<summary><b>📋 Full field reference (click to expand)</b></summary>

**Common fields (all categories)**

| Field | Description |
|-------|-------------|
| `id` | Unique Blocket listing ID |
| `url` | Full listing URL on blocket.se |
| `title` | Listing headline |
| `price` | Asking price in SEK (e.g. `"8 500 kr"`) |
| `location` | City or town |
| `category` | Blocket search key / category |
| `sellerName` | Dealer or organisation name, if any |
| `sellerType` | `Privat` (private) or `Företag` (business) |
| `shipping` | `Kan skickas` if the item can be shipped, else `null` |
| `brand` | Product brand from listing attributes |
| `imageUrl` | Cover photo URL |
| `imageUrls` | All photo URLs, comma-separated |
| `tradeType` | `Säljes` (for sale) / `Bytes` (swap) / `Skänkes` (giveaway) |
| `publishedAt` | ISO 8601 publication timestamp |
| `lat` / `lng` | GPS latitude / longitude of the listing |
| `scrapedAt` | ISO 8601 scrape timestamp |

**🚗 Vehicle fields (`car` / `mc` / `boat` only)**

| Field | Description |
|-------|-------------|
| `make` | Vehicle brand (e.g. Volvo, BMW) |
| `model` | Vehicle model name |
| `modelSpec` | Full specification string |
| `year` | Model year |
| `mileage` | Odometer in *mil* (1 mil = 10 km, so `8 500 mil` = 85,000 km) |
| `fuel` | Fuel type — Bensin / Diesel / El / Hybrid |
| `gearbox` | Transmission — Automat / Manuell |
| `regno` | Swedish registration number, if listed |

</details>

### 💡 Use cases

- **Price monitoring & comparison** — track second-hand prices across Sweden and diff over time on a schedule.
- **Arbitrage detection** — spot price gaps between Blocket and other marketplaces.
- **Used-car valuation** — build Swedish car-pricing tools from real market data by model, year and mileage.
- **Dealer vs private analysis** — compare `Företag` and `Privat` seller pricing and inventory.
- **Competitive intelligence** — monitor a dealership's or brand's live listings and price positioning.
- **AI training datasets** — collect Swedish-language product listings with structured attributes.
- **Price-alert tools** — power alerts for specific items, models or categories.

### 👥 Who uses it

Second-hand & resale sellers · Swedish car dealers and valuation teams · e-commerce & pricing analysts · arbitrage and reseller operators · market researchers & data journalists · developers building price-tracking, alert and comparison tools.

### 💰 Pricing

This Actor runs on a simple **pay-per-result** model — you are only charged for the listings actually saved to your dataset, with no separate platform fees to calculate. Try it on the **free tier** first, then scale up. See the **Pricing** tab on this page for the current rate.

### ❓ Frequently Asked Questions

#### Is this a Blocket.se API alternative?

Yes. Blocket has no public developer API, so this Actor works as an unofficial **Blocket.se API alternative** — it queries Blocket's own `recommerce` and `mobility` search endpoints and returns structured JSON for marketplace goods and vehicles.

#### Can I scrape Blocket.se without an API or login?

Yes. The Actor calls Blocket's public search API directly, so you get a complete Blocket.se data export with **no login, no cookies and no browser session** required — only an Apify account.

#### How do I export Blocket.se data to CSV or JSON?

Run the Actor, then download the dataset from Apify in **CSV, JSON, Excel or XML**. Every listing — prices, images, seller details and vehicle attributes — is exported in one structured table, one row per ad.

#### How do I scrape used-car listings from Blocket.se?

Set **Category** to `car` (or `mc` / `boat`) to use Blocket's mobility API, which returns extra vehicle fields like make, model, year, mileage, fuel type and gearbox. Add a make/model in **Search Query** (e.g. `Volvo V70`) to narrow further.

#### Can I scrape Blocket listings by Swedish region?

Yes. Pick a region code in the **Region** dropdown — Stockholm, Skåne, Västra Götaland and more — to limit results to one county instead of all of Sweden.

#### Is scraping Blocket.se legal?

This Actor collects only publicly available listing data visible to any website visitor without login. Always use the scraped data responsibly and in compliance with applicable laws in your jurisdiction and Blocket's terms.

#### How much data can I get in one run?

As much as you like — set **Max Results** to any number, or `0` for unlimited. The Actor paginates Blocket's search API automatically and deduplicates, so broad category exports can return thousands of listings per run.

#### What language are the listings in?

Swedish. Titles and attribute values (e.g. `Säljes`, `Företag`, `Bensin`, `Automat`) appear in Swedish exactly as shown on blocket.se.

#### What is "mil" in mileage?

Swedish vehicles use *mil* (Swedish mile = 10 km) for odometer readings, so `8 500 mil` = 85,000 km.

#### Can I filter by a specific car make or model?

Yes — put the make/model in **Search Query** (e.g. `Volvo V70`) and set **Category** to `car`.

### 🔗 More marketplace & classifieds scrapers by logiover

Building a cross-market pricing or resale dataset? Pair Blocket with the rest of the European classifieds & marketplace suite:

| Country / Platform | Actor |
|---|---|
| 🇳🇴 Norway | [Finn.no Scraper](https://apify.com/logiover/finn-no-scraper) |
| 🇩🇰 Denmark | [DBA.dk Scraper](https://apify.com/logiover/dba-dk-scraper) |
| 🇳🇱 Netherlands | [Marktplaats.nl Scraper](https://apify.com/logiover/marktplaats-nl-scraper) |
| 🇫🇷 France | [Leboncoin Scraper](https://apify.com/logiover/leboncoin-scraper) |
| 🇷🇺 Russia | [Avito.ru Scraper](https://apify.com/logiover/avito-ru-scraper) |
| 🇺🇸 USA | [Craigslist Scraper](https://apify.com/logiover/craigslist-scraper) |
| 🇯🇵 Japan | [Mercari Japan Scraper](https://apify.com/logiover/mercari-japan-scraper) |
| 🏨 Travel | [Booking Hotels Prices Scraper](https://apify.com/logiover/booking-hotels-prices-scraper) · [Airbnb Scraper](https://apify.com/logiover/airbnb-scraper) |
| 🛒 E-commerce | [Lazada Scraper](https://apify.com/logiover/lazada-scraper) |
| ⭐ Reviews | [Trustpilot Reviews Scraper](https://apify.com/logiover/trustpilot-reviews-scraper) |

👉 Browse all **[logiover scrapers on Apify Store](https://apify.com/logiover)** — 180+ actors across real estate, jobs, crypto, social media & B2B data.

### ⏰ Scheduling & integration

Schedule this Actor on Apify to track the Swedish second-hand market daily or weekly and diff prices over time. Export results to JSON, CSV or Excel, sync to **Google Sheets**, or push to your database, BI tools and webhooks through the Apify API. Connect it to **Make, n8n or Zapier** to build automated price-monitoring and alerting pipelines.

### 🤖 AI Agents, MCP & RAG Integration

**Blocket.se Scraper – Cars, Electronics & Marketplace** works natively as an on-demand data tool for AI assistants and autonomous workflows.

Connect this Actor directly to **Apify AI**, **Claude Desktop**, **Cursor**, **VS Code**, **Windsurf**, **LangChain**, or **LlamaIndex** via the official **Apify MCP Server** — no custom wrapper code needed:

```json
{
  "mcpServers": {
    "apify": {
      "type": "http",
      "url": "https://mcp.apify.com?tools=logiover/blocket-se-scraper"
    }
  }
}
```

- **Schema-typed inputs & outputs:** Clean JSON records with explicit `.actor/input_schema.json` and `.actor/output_schema.json` definitions so LLM agents infer parameters and parse fields accurately without HTML noise.
- **Bounded & predictable runs:** Built-in volume caps and pay-per-result budget guards prevent runaway agent tool loops.
- **RAG & automation ready:** Stream run datasets straight into vector stores, n8n, Make, Zapier, or webhook pipelines.

### 💬 Support, Issues & Reviews

- **Bug reports & target-site changes:** Hit an unexpected empty result or selector change? [Open a ticket in the Issues tab](https://apify.com/logiover/blocket-se-scraper/issues) with your **Run ID** or sample input — we actively monitor issues and ship fixes fast.
- **Feature & field requests:** Need an additional data attribute or filter? [Request it in the Issues tab](https://apify.com/logiover/blocket-se-scraper/issues).
- **Enjoying this Actor?** If it saved you engineering time, please consider leaving an honest [review on Apify Store](https://apify.com/logiover/blocket-se-scraper/reviews) or bookmarking [logiover/blocket-se-scraper](https://apify.com/logiover/blocket-se-scraper) — organic developer feedback helps others discover reliable tools and keeps maintenance prioritized.

### ⚖️ Legal

This Actor extracts only publicly available listing data and is intended for legitimate research, analytics and price-monitoring use. You are responsible for complying with Blocket's terms of service and any applicable local laws in your jurisdiction.

***

This Actor is an independent tool. It is not affiliated with, endorsed by, or sponsored by Blocket.se; Blocket.se and all other trademarks mentioned here are the property of their respective owners.

### 📝 Changelog

#### 2026-11-11

- Added reliable terminal run status telemetry and structured Apify AI / MCP Server (`mcp.apify.com`) tool configuration.
- Added direct Issues & Reviews support links and refreshed live maintenance verification.

#### 2026-11-01

- Monthly health check (2026-11-01): a live run on the current build completed successfully and returned data. Input options, output fields and pricing are unchanged.
- README refreshed: 1 link to retired Actors removed; independence disclaimer added.

#### 2026-10-15

- A run that reaches its maximum cost per run now stops cleanly with its results saved and a status message, instead of ending as aborted.
- A proxy group your account cannot use no longer stops the run at start-up; it falls back to the default Apify Proxy.
- Runs with a short timeout (API and AI-agent calls) now finish inside it with what they collected, instead of being cut off.
- Memory is managed within the run's own limit, which removes a rare out-of-memory crash on large pages.
- The prefilled example for `maxResults` is now 285 (was 100).
- The default used when the field is left out for `maxResults` is now 5,714 (was 100).

#### 2026-09-23

- Fleet-wide quality audit. Verified end to end against live data and re-checked the input schema, the output columns and the run configuration.
- Output verified on a live run: 25 columns returned, 98.1% of cells populated.
- Run reliability reviewed: 100.0% of public runs succeeded in the last 30 days.
- Input schema, output schema and pricing configuration reviewed.

#### 2026-09-01

- Fleet-wide health check. Verified against this Actor's real run history: 30-day success rate, output row counts, per-field fill rates, and peak memory against the configured memory limit.
- Reviewed for the failure patterns that have cost this fleet runs — unguarded proxy setup, retry loops that can outlast the run's own time budget, and full-page HTML parsing that can exhaust a small container.
- No change to input, output fields or scraping logic.

#### 2026-08-11

- Maintenance release: refreshed the build and dependencies.
- Re-verified live execution, non-empty structured output and dataset field/type integrity.
- Reviewed reliability (retries, pagination) and output quality as part of a full-fleet QA pass.

#### 2026-08-01

- Completed the August 2026 full health check: verified empty/programmatic default, Console UI default, and two source-informed alternative inputs on Apify.
- Confirmed successful live execution, non-empty structured output, dataset-field/type integrity, and logical sample quality within the 5-minute quality window.

#### 2026-07-06

- ✨ README overhaul: rising-star formatting, badge row, named example scenarios, collapsible category/region and full field references, expanded keyword-gap FAQ and marketplace cross-promo grid.

#### 2026-07-01

- Maintenance pass: re-verified end-to-end on live data and confirmed successful runs within the 5-minute quality window on the default input.
- Sharpened Store metadata (SEO title & description) and expanded the FAQ with high-intent, long-tail questions for easier discovery in Google and Apify Store search.
- Added ready-to-run example tasks that cover common real-world use cases.

#### 2026-06-28

- Health check passed — actor verified working end-to-end on the Apify platform.
- Changelog refreshed for Store quality compliance.

#### 2026-06-20

- Maintenance & reliability pass: re-verified end-to-end against live data and confirmed the Actor completes successfully within the 5-minute quality window on the default input.
- Refreshed the prefilled example input and tuned run defaults for faster, lower-cost runs.

#### 2026-06-15

- Reliability pass: re-verified end-to-end on live data with real-world inputs. Routine maintenance build.

#### 2026-06-07

- Docs: added coverage for Blocket.se API alternative usage, exporting Blocket listings to CSV/JSON, and scraping Blocket without an API or login.

#### 2026-06-05

- 🛡️ Reliability fix: results are no longer dropped by strict output validation — runs now complete cleanly even at high volume (thousands of results).
- ⚡ Stability & performance hardening; fresh rebuild.

#### 2026-06-04

- Verified live & refreshed build — reliability/maintenance pass.

***

\*Maintained: last verified 2026-11-11 — checked end-to-end against live run history (reliability, output fields and types, and time/memory budgets).

# Changelog

This Actor's version history is a separate document: https://apify.com/logiover/blocket-se-scraper/changelog.md

# Actor input Schema

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

Keyword to search for on Blocket.se. Examples: 'iPhone 15', 'Volvo V70', 'cykel', 'soffa'. Leave empty to browse all listings in the selected category.

## `category` (type: `string`):

Which Blocket category to search. Vehicle columns — make, model, year, mileage, fuel, gearbox — are only published on vehicle categories, so leaving this empty searches everything but returns those columns blank.

## `location` (type: `string`):

Filter listings by Swedish region or county. Uses Blocket's internal region codes. Leave empty to search all of Sweden (Hela Sverige).

## `maxResults` (type: `integer`):

Maximum number of listings to scrape and save to the dataset. The scraper paginates automatically until this limit is reached. Leave input empty to browse the most recent listings across all of Sweden. Set to 0 for unlimited (use with caution on broad queries).

## `proxyConfiguration` (type: `object`):

Apify proxy settings used for all requests to Blocket.se. Residential proxies are recommended for large-scale scraping to avoid blocks.

## Actor input object example

```json
{
  "searchQuery": "",
  "category": "car",
  "location": "",
  "maxResults": 285,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All records extracted by this run. Open the Dataset tab to browse, filter, and export as CSV, JSON, or Excel.

# 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 = {
    "category": "car",
    "maxResults": 285
};

// Run the Actor and wait for it to finish
const run = await client.actor("logiover/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 = {
    "category": "car",
    "maxResults": 285,
}

# Run the Actor and wait for it to finish
run = client.actor("logiover/blocket-se-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 '{
  "category": "car",
  "maxResults": 285
}' |
apify call logiover/blocket-se-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,logiover/blocket-se-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/DdFgwFGfUTlyEIted/builds/4CqbgeWtFGPk1dpth/openapi.json
