# Cdiscount Product Search API Documentation

Scrappa's `GET /api/cdiscount/search` returns Cdiscount (cdiscount.com) products for a query as JSON. A page holds up to 47 offers. Each item has `id`, `offer_id`, `title`, `url`, `price`, `original_price`, `discount_percent`, `currency`, `rating`, `review_count`, `seller_name`, `images` and facets. Prices are EUR numbers; ids are unchanged from Cdiscount. `min_price` and `max_price` are checked on the returned price, so no item that violates a filter is returned. A page past the last returns an empty list. When a price range removes every item on a page, that empty page is not charged (`meta.credits_charged` is 0).
## Credits

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

- **Documentation:** [https://scrappa.co/docs/cdiscount-api/cdiscount_search](https://scrappa.co/docs/cdiscount-api/cdiscount_search)
- **API group:** Cdiscount API
- **Endpoint:** `GET https://scrappa.co/api/cdiscount/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 iphone. |
| `category` | string | No | Category or department id from search facets. |
| `min_price` | number | No | Lowest price in EUR. |
| `max_price` | number | No | Highest price in EUR. |
| `sort` | string | No | relevance, rating, price_low_to_high or price_high_to_low. |
| `page` | integer | No | Result page, 1-200. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/cdiscount/search?query=iphone&max_price=500"
```

## Example response

```json
{
    "success": true,
    "query": "iphone",
    "items": [],
    "total": 2715,
    "page": 1,
    "page_size": 47,
    "currency": "EUR",
    "meta": {
        "endpoint_family": "cdiscount-search",
        "billable": true,
        "attempts": 1,
        "credits_charged": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing, unknown or unusable. Unknown parameters are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Cdiscount 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)
