# SPAR Denmark Scraper — Everyday Grocery Prices & EAN (`studio-amba/spar-dk-scraper`) Actor

Scrape everyday grocery prices, EAN codes, pack sizes, unit prices and current promotions from SPAR Denmark store webshops (the Spartid click-and-collect platform). No login required. Covers whichever SPAR store(s) you point it at — not every physical SPAR runs Spartid.

- **URL**: https://apify.com/studio-amba/spar-dk-scraper.md
- **Developed by:** [Studio Amba](https://apify.com/studio-amba) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.20 / 1,000 result scrapeds

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

## SPAR Denmark Scraper

Scrape everyday grocery prices, EAN barcodes, pack sizes and current promotions from SPAR Denmark's store webshops — clean, structured product data, no login required.

SPAR Denmark's main site (spar.dk) has no shop of its own. But individual SPAR stores run a "click & collect" webshop (the Spartid platform, e.g. `kastrup.spar.dk`) with a full everyday-priced product range — the same range you'd find on the shelf, not just weekly leaflet offers. This actor calls that webshop's own product API directly.

### Why use this actor?

If you track Danish grocery prices, build a price-comparison tool, match products by EAN, or need a Nordic retail dataset, you need the everyday shelf price, not just the weekly flyer. This actor returns SPAR's regular price for every product, flags which ones currently have an active promo, and gives you the EAN, pack size and a computed unit price for each one.

Typical users:

- Price-intelligence and price-comparison platforms tracking Danish retail.
- Brands and suppliers matching their catalogue by EAN barcode.
- Market researchers and analysts building Nordic grocery datasets.
- Developers who need a clean product feed instead of scraping HTML themselves.

### How to scrape SPAR Denmark data

1. Open the actor in the Apify Console.
2. Enter a **store name** — the subdomain slug of a SPAR store that runs the Spartid webshop, e.g. `kastrup` or `erslev`. The actor looks up that store's internal id automatically.
3. Optionally enter a **search query** in Danish, e.g. `mælk`, `kaffe`, `smør`. Leave it empty to get the whole store.
4. Set **maxResults** to how many products you want (a full store is roughly 15,000-20,000 SKUs).
5. Leave the proxy on the default Apify setting and click **Start**.
6. When the run finishes, download the results as JSON, CSV, Excel or feed them to an API.

The actor resolves the store's internal id from its homepage, fetches its category tree for readable category names, then pulls the product catalogue from the store's own product API in a single request. When you give a search query, filtering happens after the fetch, since the source has no server-side search of its own.

### Input

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `storeName` | String | No | SPAR store subdomain, e.g. `kastrup` (default: `kastrup`) |
| `merchantId` | Integer | No | Advanced: skip the storeName lookup with a known internal store id |
| `searchQuery` | String | No | Keyword filter in Danish, applied after fetching |
| `categoryId` | Integer | No | Advanced: restrict to one category id from the store's category tree |
| `maxResults` | Integer | No | Maximum products to return (default: 100) |
| `proxyConfiguration` | Object | No | Apify proxy settings (default Apify proxy works — no anti-bot on this source) |

#### Example input

```json
{
    "storeName": "kastrup",
    "searchQuery": "mælk",
    "maxResults": 20,
    "proxyConfiguration": { "useApifyProxy": true }
}
```

#### Stores known to run the Spartid webshop

Not every physical SPAR store has one — `kastrup` and `erslev` are both verified live. If a `storeName` you try returns "could not find a merchantId", that store doesn't run this platform; check `spar.dk/spartid` for the current list of participating stores.

### Output

Each result contains:

| Field | Type | Example |
|-------|------|---------|
| `name` | String | `"Ota Solgryn 1/4 Pl"` |
| `brand` | String or null | `"Ota"` — best-effort, see limitations |
| `price` | Number | `16` — what you pay right now, per unit |
| `originalPrice` | Number or null | `26.95` — everyday price, shown only when `isPromo` is true |
| `everydayPrice` | Number | `26.95` — the regular shelf price, always populated |
| `isPromo` | Boolean | `true` |
| `promoQuantity` | Integer or null | `2` — units the promo price covers (1 = plain discount, 2+ = multi-buy) |
| `promoBundlePrice` | Number or null | `35` — the raw quoted price for `promoQuantity` units (e.g. "2 for 35 kr") |
| `currency` | String | `"DKK"` |
| `ean` | String or null | `"5701164710396"` |
| `unitPrice` | String or null | `"28,37 DKK/kg"` — computed from the everyday price and pack size |
| `packageSize` | String or null | `"950 GR"` |
| `category` | String or null | `"Morgenmad"` |
| `inStock` | null | Always null — see limitations |
| `retailer` | String | `"SPAR Denmark"` |
| `storeName` | String | `"kastrup"` — prices are per-store, not chain-wide |
| `productId` | String | `"384672258"` |
| `url` | String | Constructed product page URL |
| `imageUrl` | String or null | Product image URL |
| `scrapedAt` | String | ISO 8601 timestamp |

### Example output

```json
{
    "name": "Ota Solgryn 1/4 Pl",
    "brand": "Ota",
    "price": 16,
    "originalPrice": 26.95,
    "everydayPrice": 26.95,
    "isPromo": true,
    "promoQuantity": 1,
    "promoBundlePrice": 16,
    "currency": "DKK",
    "ean": "5701164710396",
    "unitPrice": "28,37 DKK/kg",
    "packageSize": "950 GR",
    "category": "Morgenmad",
    "inStock": null,
    "retailer": "SPAR Denmark",
    "storeName": "kastrup",
    "productId": "384672258",
    "url": "https://kastrup.spar.dk/produkter/ota-solgryn-1-4-pl-5701164710396",
    "imageUrl": "https://dagrofa-dam.s3.eu-central-1.amazonaws.com/PROD/1200x1200/5701164710396.1200x1200.jpg",
    "scrapedAt": "2026-09-09T15:00:54.684Z"
}
```

### Notes and limitations

- **This is per-store data, not a chain-wide price list.** SPAR Denmark is a franchise banner — each store sets its own prices. `storeName` and `merchantId` identify which specific store's shelf you're reading. Run the actor once per store you want to compare.
- **Not every SPAR store has a webshop.** Only stores enrolled in the Spartid click-and-collect program expose this data. If a store doesn't run it, the actor fails with a clear error rather than returning empty or wrong data.
- **`everydayPrice` vs `price`**: `everydayPrice` is always the regular shelf price. `price` is what a shopper actually pays right now — equal to `everydayPrice` normally, or the normalized per-unit promo price when `isPromo` is true. Some SPAR promos are multi-buy deals ("2 for 35 kr") rather than a flat per-unit cut; `promoQuantity` and `promoBundlePrice` preserve the original deal shape so you're never guessing whether a discount is per-unit or per-bundle.
- **`brand` is best-effort** — SPAR's product API has no dedicated brand field. This actor takes the first word of the product name, which is often (not always) the brand.
- **`inStock` is always null.** The source catalogue API is a pricing feed, not a live inventory system — it doesn't expose stock levels, so this actor never guesses one.
- **`url` is a constructed URL**, following the site's confirmed `{store}.spar.dk/produkter/{name-slug}-{ean}` pattern. The EAN suffix is exact; the name-slug is built from the product name and may occasionally not match the live page's exact slug.
- The source has no free-text search endpoint — `searchQuery` filters client-side after the catalogue is fetched, so a search on a large store still reads the whole catalogue first.
- Run cost only settles once a run reports SUCCEEDED — a mid-run dataset read shows a cost far below the final total.

### Cost

Pricing is pay-per-result: **$0.002 per result**, plus a $0.005 flat fee per run start. The actor calls a JSON API directly (no browser), so a full store catalogue (15,000-20,000 products) typically finishes in well under a minute.

### Related Scrapers

Build a complete view of Danish and European grocery retail with these sibling scrapers from Studio AMBA:

- **[Føtex Scraper](https://apify.com/studio-amba/foetex-scraper)** — Danish supermarket products and prices (foetex.dk).
- **[Bilka Scraper](https://apify.com/studio-amba/bilka-scraper)** — Danish hypermarket products (bilka.dk).
- **[REMA 1000 Denmark Scraper](https://apify.com/studio-amba/rema1000-dk-scraper)** — Danish discount-grocery products and campaign prices (rema1000.dk).
- **[Netto Denmark Offers Scraper](https://apify.com/studio-amba/netto-dk-offers-scraper)** — Netto Denmark's weekly leaflet offers (netto.dk).
- **[Coop Scraper](https://apify.com/studio-amba/coop-scraper)** — Kvickly, SuperBrugsen, Brugsen and 365discount weekly offers (Coop Denmark).
- **[Kaufland CZ Scraper](https://apify.com/studio-amba/kaufland-cz-scraper)** — Czech supermarket products and prices (kaufland.cz).

# Actor input Schema

## `storeName` (type: `string`):

SPAR store subdomain slug, e.g. 'kastrup' for kastrup.spar.dk or 'erslev' for erslev.spar.dk. The actor resolves the store's internal merchantId automatically from this.

## `merchantId` (type: `integer`):

Optional: the store's internal merchantId on the longjohnapi backend, if already known. Skips the storeName lookup. Leave empty in normal use.

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

Filter products by keyword (e.g. 'mælk', 'kaffe'). The source API has no server-side search, so this is applied after fetching the store's catalogue. Leave empty to get all products.

## `categoryId` (type: `integer`):

Optional: restrict to one category id from the store's category tree (server-side filter). Leave empty for the whole store.

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

Maximum number of products to return. A full store catalogue is roughly 15,000-20,000 SKUs.

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

Proxy settings. Not needed — the catalogue API and store homepages are public with no anti-bot or geo-lock (verified). Left at automatic/free pool by default.

## Actor input object example

```json
{
  "storeName": "kastrup",
  "searchQuery": "mælk",
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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 = {
    "storeName": "kastrup",
    "searchQuery": "mælk",
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/spar-dk-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 = {
    "storeName": "kastrup",
    "searchQuery": "mælk",
    "maxResults": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("studio-amba/spar-dk-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 '{
  "storeName": "kastrup",
  "searchQuery": "mælk",
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call studio-amba/spar-dk-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,studio-amba/spar-dk-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/M9coe9V6v9kjQhliP/builds/egstJpjuLb3kQNJLV/openapi.json
