# Bonprix Product & Availability Scraper (`truenorth/bonprix-product-scraper`) Actor

Extract Bonprix.de color/article variants with prices, discounts, colors, images, and per-size availability from SSR listings.

- **URL**: https://apify.com/truenorth/bonprix-product-scraper.md
- **Developed by:** [TrueNorth](https://apify.com/truenorth) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 1,000 bonprix products extracteds

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?

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

## Bonprix Product & Availability Scraper

Extract current Bonprix.de product data from server-rendered (SSR) search listings.
Each Dataset row represents one color/article variant with prices, discounts,
colors, images, and size availability. No browser or product-detail request is
used. This Bonprix scraper produces structured retail records for export and
analysis.

### What this Actor extracts

- Article, product, master-style, and color identifiers
- Product title, style name, brand, color name, and color hex value
- Current price, original price when supplied, discount percentage, and currency
- Product URL and normalized product images
- Every listed size with source-provided boolean availability
- Derived `inStock` status, search query, page number, and observation timestamp

Data comes from strict `JSON.parse` extraction of Bonprix's server-rendered
`window.modelContainer` listing state. One product tile can contain several
style/color variants, and the Actor emits each unique article/color variant.

### How it works

1. Enter one or more Bonprix search queries and a global result limit.
2. The Actor requests SSR search pages sequentially with `CheerioCrawler`.
3. It validates the response, embedded model, pagination, URLs, and every output
   row.
4. It deduplicates globally by `articleId`, stages all rows, and commits only
   after every required listing request succeeds.
5. Export the Dataset as JSON, CSV, Excel, or through the Apify API.

### Input

Public input contains only:

- `searchQueries`: 1–20 search terms, processed in supplied order.
- `maxItems`: global cap from 1 to 10,000; default 100.
- `proxyConfiguration`: Apify proxy configuration.

```json
{
  "searchQueries": ["kleid", "sommerkleid"],
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  }
}
```

Queries receive Unicode Normalization Form C (NFC) and whitespace normalization.
Case-insensitive duplicates use first-wins behavior. Unknown input keys fail before
network access.

### Output sample

Verified against `tests/fixtures/search-kleid.html`:

```json
{
  "articleId": "926761",
  "productId": "3610946897",
  "masterStyleId": "2372508000",
  "title": "Kleid und Bolero aus reiner Baumwolle (2-tlg.Set)",
  "brand": "bonprix",
  "styleName": null,
  "url": "https://www.bonprix.de/produkt/kleid-und-bolero-aus-reiner-baumwolle-2-tlg-set-aschrosa-natur-gebluemt-926761/",
  "currentPrice": 29.99,
  "oldPrice": null,
  "discountPercent": 0,
  "currency": "EUR",
  "colorId": "3610931920",
  "colorName": "aschrosa/natur geblümt",
  "colorHex": "#cca2ab",
  "images": [
    "https://image01.bonprix.de/assets/584x817/1753319189/25084593-ZI5dFZrd.webp"
  ],
  "sizes": [
    {
      "id": "3610931959",
      "name": "92",
      "available": true
    }
  ],
  "inStock": true,
  "searchQuery": "kleid",
  "pageNumber": 1,
  "scrapedAt": "2026-07-24T12:00:00.000Z"
}
```

`maxItems` counts unique validated rows only. Reaching the cap mid-page does not
overshoot. All sizes remain nested in server order, including unavailable sizes.

### Use cases

- Current Bonprix price and discount research
- Fashion assortment and color analysis
- Size-availability snapshots
- Product-data exports for BI, catalog matching, and AI pipelines
- Independently scheduled comparisons performed outside this Actor

### Reliability and limitations

HTTP 403/429 responses, challenge content, unexpected redirects, malformed or
duplicate model assignments, schema drift, unsafe URLs, unsupported response
limitations, and ambiguous empty pages fail explicitly. Empty success requires a
valid search model, consistent pagination, and an explicit Bonprix empty-result
marker.

Scope is SSR search-listing extraction only:

- No PDP enrichment or product-detail requests (PDP means product detail page)
- No EAN (European Article Number) extraction
- No descriptions, reviews, ratings, or review counts
- No exact stock quantities; only source-provided per-size boolean availability
- No delivery estimates or cart/session data
- No price history, change tracking, or alerts
- No browser bypass or anti-bot bypass claim; detected blocks fail explicitly

Availability reflects listing observation time and does not reserve inventory.

### Development

```sh
pnpm install --frozen-lockfile
pnpm test
pnpm test:coverage
pnpm lint
pnpm format:check
pnpm typecheck
pnpm build
apify validate-schema
```

Private fixture verification is absent from public input and rejected when
`Actor.isAtHome()` is true:

```sh
BONPRIX_LOCAL_FIXTURE_MODE=1 \
apify run --purge \
  --input '{"searchQueries":["kleid"],"maxItems":5,"proxyConfiguration":{"useApifyProxy":false}}'
```

# Actor input Schema

## `searchQueries` (type: `array`):

Bonprix search terms. Queries run in supplied order.

## `maxItems` (type: `integer`):

Global maximum unique article/color variants saved across all queries.

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

Proxy settings used for Bonprix requests.

## Actor input object example

```json
{
  "searchQueries": [
    "kleid"
  ],
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  }
}
```

# Actor output Schema

## `products` (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 = {
    "searchQueries": [
        "kleid"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": []
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("truenorth/bonprix-product-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 = {
    "searchQueries": ["kleid"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": [],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("truenorth/bonprix-product-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 '{
  "searchQueries": [
    "kleid"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": []
  }
}' |
apify call truenorth/bonprix-product-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,truenorth/bonprix-product-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/MczbVNCpqweDNYTY7/builds/YTkINhakRA3IFTsWc/openapi.json
