# Digitec Switzerland Product Search API Documentation

`GET /api/digitec_ch/search` returns Digitec Switzerland products as structured JSON. Prices are numbers in CHF.

## What you get

Each item has `id`, `relay_id`, `title`, `brand`, `price`, `original_price`, `discount_percent`, `currency`, `rating`, `review_count`, `availability`, `image`, `gallery` and `facets`. Use `id` unchanged with the product and reviews endpoints.

## Filters

`query` or `category` selects the result set. `sort` accepts relevance, price_asc and price_desc. Price sorts use the storefront relevance order and sort the fetched window locally. `meta.sorted_within_page` is true and the window is at most 3 pages.

`brand` must match a label in `facets`. `brand_id` takes a facet option id unchanged and is applied upstream. An unknown brand returns 422 before any lookup. Do not broaden a brand alias.

`price`, `min_price` and `max_price` are not published by this storefront surface. They return 422 and cost nothing. Use `facets` to pick a range. `facets=summary` caps each value list at 5 entries and keeps the counts; the default shape is unchanged. A row outside a filter is never relabeled.

## Pages

`page` is 1-3. Page n returns page n items. An empty page stays empty and costs nothing. A redirecting query returns an empty set with `meta.unavailable_reason.redirect`.

## Credits

A successful request costs **1 credit**. Errors, challenges and empty result sets cost nothing. The response shows the charge in `meta.credits_charged`.

- **Documentation:** [https://scrappa.co/docs/galaxus-api/digitec_ch_search](https://scrappa.co/docs/galaxus-api/digitec_ch_search)
- **API group:** Galaxus and Digitec API
- **Endpoint:** `GET https://scrappa.co/api/digitec-ch/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | No | Search words. Use this or category. |
| `category` | string | No | Category id or producttype path. Use this or query. |
| `sort` | string | No | relevance, price_asc or price_desc. |
| `price` | number | No | Highest price in CHF. Alias for max_price. |
| `min_price` | number | No | Lowest price in CHF. |
| `max_price` | number | No | Highest price in CHF. |
| `brand` | string | No | Facet brand label. Unknown labels return 422. |
| `brand_id` | string | No | Facet option id from facets. Applied upstream unchanged. |
| `facets` | string | No | summary caps value lists and keeps counts. Default unchanged. |
| `page` | integer | No | Result page, 1-3. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/digitec-ch/search?query=usb+kabel"
```

## Example response

```json
{
    "success": true,
    "site": "digitec_ch",
    "query": "usb kabel",
    "category": null,
    "items": [
        {
            "position": 1,
            "id": "62514025",
            "relay_id": "UHJvZHVjdApkNjI1MTQwMjU=",
            "title": "Example USB cable",
            "brand": "ExampleBrand",
            "price": 19.9,
            "original_price": 29.9,
            "discount_percent": 33,
            "currency": "CHF",
            "rating": 4.5,
            "review_count": 120,
            "availability": "Available",
            "image": "https://www.galaxus.ch/im/example.jpg",
            "gallery": [],
            "facets": []
        }
    ],
    "page": 1,
    "page_size": 20,
    "next_page": 2,
    "has_more": true,
    "cursor": null,
    "sort": "relevance",
    "applied_filters": {
        "query": "usb kabel"
    },
    "facets": [],
    "meta": {
        "endpoint_family": "galaxus-search",
        "billable": true,
        "attempts": 1,
        "sorted_within_page": false,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown, conflicting or unusable. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | The storefront could not be reached, answered with a challenge, or changed its data shape. Retryable and never billed. Clients are never rate limited. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
