# Bygma Scraper - Danish Builders Merchant Prices and Stock (`studio-amba/bygma-scraper`) Actor

Scrape product data from bygma.dk, the Danish builders merchant. Get prices with and without VAT, Bygmester club prices, brands, delivery times, stores with stock and category paths.

- **URL**: https://apify.com/studio-amba/bygma-scraper.md
- **Developed by:** [Studio Amba](https://apify.com/studio-amba) (community)
- **Categories:** E-commerce
- **Features:** Limited permissions
- **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

## Bygma Scraper

Pull product data from bygma.dk, the Danish builders merchant. The actor returns one row per product with the price including and excluding VAT, the Bygmester club price, brand, delivery time, the number of stores with the product in stock, category path and image.

Bygma sells building materials, tools, hardware, paint, garden supplies and outdoor products in Denmark. The data fits price monitoring against other Danish merchants, assortment tracking and supplier price checks.

### How to scrape Bygma data

There are two ways to tell the actor which products to read.

1. Paste product pages into `productUrls`, for example `https://www.bygma.dk/beslag-og-befastigelse/kroge/pn-dorkrog-elforzinket---8x122mm100p003701/`. The address ends in `100p` followed by the item number.
2. Leave `productUrls` empty and fill `urlKeywords`. The actor reads the shop's public product list (the sitemap) and keeps products whose address contains one of your words, for example `boremaskine`, `maling` or `dewalt`. Words are lowercase, with `oe`, `ae` and `aa` in place of the Danish letters, as they appear in the product addresses.

The actor stops at `maxResults`. If you leave everything empty, it reads the first 50 products in the product list.

Search result pages and category pages are not read. The actor only requests product pages and the sitemap that robots.txt allows.

### Input

| Field | Type | Description |
|---|---|---|
| `productUrls` | list of URLs | Bygma product pages |
| `urlKeywords` | list of words | Used when no URLs are given. Keeps products whose address contains one of the words |
| `maxResults` | number | Maximum number of products to return. Default 50 |
| `proxyConfiguration` | proxy | Apify Proxy settings. Default is Apify Proxy |

### What you get back

Each row is one product.

| Field | Description |
|---|---|
| `sku` | Bygma item number, the number at the end of the product address |
| `name` | Product name |
| `brand` | Manufacturer as listed on the page |
| `category` | Category path from the product address, top level first |
| `price` | Price including VAT in DKK |
| `priceExVat` | Price excluding VAT in DKK |
| `memberPrice` | Bygmester club price including VAT, only when it is lower than the normal price |
| `memberPriceExVat` | Bygmester club price excluding VAT |
| `currency` | DKK |
| `priceUnit` | Unit the price applies to, for example STK or M2 |
| `deliveryInfo` | Delivery text shown on the page, for example Levering 1-2 hverdage |
| `storesWithStock` | Number of Bygma stores that have the product for pickup |
| `pickupInfo` | Pickup text shown on the page |
| `size` | Size line from the specifications, when the page has one |
| `description` | Short product description |
| `imageUrl` | Main product image |
| `url` | Product page address |
| `scrapedAt` | Time of the scrape |
| `country`, `language` | `dk` and `da` |

### Example output

```json
{
  "sku": "171079",
  "name": "DEWALT Borehammer - 22 mm SDS-plus - 230V D25033K",
  "brand": "DEWALT",
  "category": "varktoj og maskiner > elvarktoj > boremaskine",
  "price": 1849,
  "priceExVat": 1479.2,
  "memberPrice": 1664.1,
  "memberPriceExVat": 1331.28,
  "currency": "DKK",
  "priceUnit": "STK",
  "deliveryInfo": "Levering 1-2 hverdage",
  "storesWithStock": 2,
  "country": "dk",
  "language": "da"
}
```

### Pricing

You pay per product returned. A run with `maxResults` set to 20 costs a few cents in platform usage plus the per-result fee.

### Tips

- Product addresses in the sitemap include category pages. The actor skips those and only reads product pages.

- Prices are the public list prices of the web shop. Prices that depend on a customer agreement are not visible without a login and are not returned.

- `memberPrice` is the price for Bygmester club members. It is empty when the club price is the same as the normal price.

- Pickup stock counts change during the day. Run the actor on a schedule to track them.

- Use `urlKeywords` with a brand name to follow one brand across the whole assortment.

### Frequently asked questions

**Does the actor need a login?** No. It reads public product pages.

**Which VAT rate is used for the ex VAT price?** Danish VAT of 25 percent. The site shows prices including VAT and the actor divides by 1.25.

**Can I read the whole assortment?** Yes. Set `maxResults` high and leave the keywords empty. The product list holds about 14,000 products.

**What happens when a product page is removed?** The actor skips it and carries on with the next one.

### Use cases

- Compare Bygma prices with Stark and other Danish merchants.
- Track price changes on a brand or product group.
- Check which products are available for pickup in many stores.

### Related actors

- [Stark Scraper](https://apify.com/studio-amba/stark-scraper) for product data from stark.dk, another Danish builders merchant.

### Support

If a product page changes layout and a field comes back empty, open an issue on the Actor page with the product address. Fixes are usually deployed within a day.

# Actor input Schema

## `productUrls` (type: `array`):

Product pages from bygma.dk, for example https://www.bygma.dk/beslag-og-befastigelse/kroge/pn-dorkrog-elforzinket---8x122mm100p003701/. The address ends in 100p followed by the item number. Leave empty to read the shop's product list.

## `urlKeywords` (type: `array`):

Used when no product URLs are given. The actor reads the shop's product list and keeps products whose URL contains one of these words, for example boremaskine or maling. Words are lowercase, as in the product URLs, with oe, ae and aa for the Danish letters. Leave empty to read the first products in the list.

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

Maximum number of products to return.

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

Proxy used for the requests. Default is Apify Proxy.

## Actor input object example

```json
{
  "urlKeywords": [
    "boremaskine"
  ],
  "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 = {
    "urlKeywords": [
        "boremaskine"
    ],
    "maxResults": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("studio-amba/bygma-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 = {
    "urlKeywords": ["boremaskine"],
    "maxResults": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("studio-amba/bygma-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 '{
  "urlKeywords": [
    "boremaskine"
  ],
  "maxResults": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call studio-amba/bygma-scraper --silent --output-dataset

```

## MCP server setup

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