# Komplett Product Search API Documentation

`GET /api/komplett/search` returns public Komplett.no products as structured JSON.

## What you get

Each item has `id` (the material number), `mpn`, `brand`, `name`, numeric `price`, `original_price`, `discount_percent`, `currency`, `in_stock`, `availability_status`, `rating`, `review_count`, full-size `images`, `url`, `energy_label` and `variant_groups`. Use `id` unchanged with the product and reviews endpoints.

## Scope

`q` searches keywords. `category_id` with optional `category_slug` uses the same parser. Prices are numbers in NOK. `store` is currently `no`. Only page one is available: a page above one returns 422 and never repeats page one under a new number. Price and sort filters return 422 until they are proven to change the result set. A zero-result search is a successful, billable response.

## Credits

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

- **Documentation:** [https://scrappa.co/docs/komplett-api/komplett_search](https://scrappa.co/docs/komplett-api/komplett_search)
- **API group:** Komplett API
- **Endpoint:** `GET https://scrappa.co/api/komplett/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 |
| --- | --- | --- | --- |
| `q` | string | No | Search words. Use this or a category. |
| `category_id` | integer | No | Category id from autocomplete. Use this or q. |
| `category_slug` | string | No | Optional category slug. |
| `store` | string | No | Storefront. Currently no. |
| `page` | integer | No | Only page 1 is available. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/komplett/search?q=b%C3%A6rbar"
```

## Example response

```json
{
    "success": true,
    "data": {
        "items": [
            {
                "position": 1,
                "id": "1328693",
                "material_number": "1328693",
                "mpn": "MG7F3_no",
                "brand": "Apple",
                "name": "iPhone 17 128 GB",
                "url": "https://www.komplett.no/product/1328693",
                "price": 12990,
                "original_price": 13990,
                "discount_percent": 7,
                "currency": "NOK",
                "in_stock": true,
                "availability_status": "InStock",
                "availability_text": "P\u00e5 lager",
                "rating": 4.5,
                "review_count": 39,
                "images": [
                    "https://www.komplett.no/product-media/b2c/en-us/1200/1328693.jpg"
                ],
                "energy_label": null,
                "variant_groups": []
            }
        ],
        "pagination": {
            "page": 1,
            "page_size": 24,
            "total": 144,
            "has_more": false
        },
        "facets": [],
        "range_facets": [],
        "sort_options": [],
        "query_id": "example-query",
        "banners": [],
        "query": "b\u00e6rbar",
        "store": "no",
        "listing": "search",
        "applied_filters": {
            "store": "no",
            "q": "b\u00e6rbar",
            "page": 1,
            "list_view": "list"
        }
    },
    "meta": {
        "endpoint_family": "komplett-search",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1,
        "unavailable_reason": []
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing, unknown or unsupported. Price and sort filters and later result pages are rejected instead of silently returning page one. Non-billable. |
| 503 | Upstream Unavailable | The storefront could not be reached or changed its page shape (`upstream_blocked`, `upstream_unavailable`, `parser_drift`). 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)
