# Boulanger Product Search API Documentation

Scrappa's `GET /api/boulanger/search` returns Boulanger (boulanger.com) products for a query or category as JSON. A page holds up to 40 items. Each item has `id`, `title`, `brand`, `price`, `original_price`, `discount_percent`, `currency`, `rating`, `review_count`, `in_stock`, `image`, `url` and `position`. Prices are EUR numbers and ids are returned unchanged from Boulanger. Page, price sort and brand are applied by the source; other filter values return 422. An empty page is a valid, non-billable success.
## Credits

A successful request costs **1 credit**. Public access is included. Errors, blocks and `404` answers cost nothing. The charge is shown in `meta.credits_charged`.

- **Documentation:** [https://scrappa.co/docs/boulanger-api/boulanger_search](https://scrappa.co/docs/boulanger-api/boulanger_search)
- **API group:** Boulanger API
- **Endpoint:** `GET https://scrappa.co/api/boulanger/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 | Yes | Search words, for example aspirateur. Use this or category. |
| `category` | string | Yes | Category slug such as aspirateur-robot. Use this or query. |
| `page` | integer | No | 1-based result page, up to 25. |
| `sort` | string | No | relevance (default), price_asc or price_desc. |
| `brand` | string | No | Brand facet in the storefront vocabulary, for example dyson. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/boulanger/search?query=aspirateur&page=1"
```

## Example response

```json
{
    "success": true,
    "query": "aspirateur",
    "items": [
        {
            "position": 1,
            "id": "1241521",
            "title": "Aspirateur balai DYSON V15 Detect Absolute",
            "brand": "DYSON",
            "url": "https://www.boulanger.com/ref/1241521",
            "price": 499,
            "currency": "EUR",
            "original_price": 799,
            "discount_percent": 37,
            "rating": 4.68,
            "review_count": 421,
            "in_stock": true,
            "image": "https://boulanger.scene7.com/is/image/Boulanger/5025155136201_h_f_l_0"
        }
    ],
    "page": 1,
    "page_size": 40,
    "total": 973,
    "meta": {
        "endpoint_family": "boulanger-search",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing, unknown or unusable. Unknown filters and sort values are rejected with `unsupported_filter`, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Boulanger could not be reached or answered with a block or an unexpected page. 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)
