# Empik Product Search API Documentation

`GET /api/empik/search` `GET /api/empik/search` returns public products for `q`. `category` accepts a path from the categories route. `priceFrom`, `priceTo`, `sort` and a 1-based `page` of 60 products are honoured. Ids are de-duplicated inside one page; sponsored tiles can repeat on a later page. Prices are numbers in PLN. Every row carries the `p<digits>` id that works unchanged on detail, reviews, specs and offers, plus a full-size image URL. A price filter that the source cannot honour is an unbilled error. An empty result with `returned` 0 is still a successful lookup.

## Credits

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

- **Documentation:** [https://scrappa.co/docs/empik-api/empik_search](https://scrappa.co/docs/empik-api/empik_search)
- **API group:** Empik API
- **Endpoint:** `GET https://scrappa.co/api/empik/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 | Yes | Search words. |
| `category` | string | No | Optional category path. |
| `priceFrom` | number | No | Minimum price in PLN. |
| `priceTo` | number | No | Maximum price in PLN. |
| `sort` | string | No | relevance, popularity, price_asc, price_desc, discount or discount_amount. |
| `page` | integer | No | 1-based result page. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/empik/search?q=wiedzmin"
```

## Example response

```json
{
    "success": true,
    "currency": "PLN",
    "query": "wiedzmin",
    "page": 1,
    "returned": 60,
    "products": [
        {
            "id": "p1102239921",
            "name": "Example",
            "price": 24.9,
            "currency": "PLN"
        }
    ],
    "meta": {
        "endpoint_family": "empik-search",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The public source has no record for that id (`not_found`). Non-billable. |
| 422 | Filter Not Available | A requested filter or page cannot be honoured by the public source (`unsupported_filter`). Non-billable. |
| 422 | Validation Error | A query parameter is missing, unknown, conflicting or unusable. Unknown parameters are rejected. Non-billable. |
| 503 | Upstream Unavailable | The source could not be reached or changed its response 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)
